feat: Add hosted domain hint when signing in through Google SSO from subdomain (#2458)

* feat: Add hosted domain hint when signing in through Google SSO from subdomain

closes #2454
This commit is contained in:
Tom Moor
2021-08-20 14:03:52 -07:00
committed by GitHub
parent 0be40609ed
commit e613ec732b
3 changed files with 38 additions and 11 deletions

View File

@ -25,11 +25,19 @@ function filterProviders(team) {
find(team.authenticationProviders, { name: provider.id, enabled: true })
);
})
.map((provider) => ({
id: provider.id,
name: provider.name,
authUrl: provider.authUrl,
}));
.map((provider) => {
const authProvider = team
? find(team.authenticationProviders, {
name: provider.id,
})
: undefined;
return {
id: provider.id,
name: provider.name,
authUrl: `${provider.authUrl}?authProviderId=${authProvider?.id || ""}`,
};
});
}
router.post("auth.config", async (ctx) => {