#11: Provide socials in the register

This commit is contained in:
garronej 2021-06-15 17:32:03 +02:00
parent a501af669c
commit 9276b08f4b
3 changed files with 67 additions and 1 deletions

View File

@ -185,5 +185,59 @@
return out; return out;
})(), })(),
"social": {
"displayInfo": (function (){
<#attempt>
return ${social.displayInfo?c};
<#recover>
</#attempt>
})(),
"providers": (()=>{
<#attempt>
<#if social.providers??>
var out= [];
<#attempt>
<#list social.providers as p>
out.push({
"loginUrl": (function (){
<#attempt>
return "${p.loginUrl?no_esc}";
<#recover>
</#attempt>
})(),
"alias": (function (){
<#attempt>
return "${p.alias}";
<#recover>
</#attempt>
})(),
"providerId": (function (){
<#attempt>
return "${p.providerId}";
<#recover>
</#attempt>
})(),
"displayName": (function (){
<#attempt>
return "${p.displayName}";
<#recover>
</#attempt>
})()
});
</#list>
<#recover>
</#attempt>
return out;
</#if>
<#recover>
</#attempt>
})()
}
} }
</script> </script>

View File

@ -130,6 +130,15 @@ export declare namespace KcContext {
* (https://github.com/micedre/keycloak-mail-whitelisting) * (https://github.com/micedre/keycloak-mail-whitelisting)
*/ */
authorizedMailDomains?: string[]; authorizedMailDomains?: string[];
social: {
displayInfo: boolean;
providers?: {
loginUrl: string;
alias: string;
providerId: string;
displayName: string;
}[]
};
}; };
export type Info = Common & { export type Info = Common & {

View File

@ -168,7 +168,10 @@ export const kcRegisterContext: KcContext.Register = {
"*.yet-another-example.com", "*.yet-another-example.com",
"*.example.com", "*.example.com",
"hello-world.com" "hello-world.com"
] ],
"social": {
"displayInfo": true
},
}; };
export const kcInfoContext: KcContext.Info = { export const kcInfoContext: KcContext.Info = {