Set default oAuth scopes for azure and keycloak. Allow passing custom… (#207)

* Set default oAuth scopes for azure and keycloak. Allow passing custom query parameters from the OauthProviders component.

* Pass return path if a next query parameter is provided. Use home path otherwise.
This commit is contained in:
Giancarlo Buomprisco
2025-03-09 11:17:30 +07:00
committed by GitHub
parent 08cd6983f4
commit b265f596da
3 changed files with 28 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
interface SignInPageProps {
searchParams: Promise<{
invite_token?: string;
next?: string;
}>;
}
@@ -24,19 +25,19 @@ export const generateMetadata = async () => {
};
};
const paths = {
callback: pathsConfig.auth.callback,
home: pathsConfig.app.home,
joinTeam: pathsConfig.app.joinTeam,
};
async function SignInPage({ searchParams }: SignInPageProps) {
const inviteToken = (await searchParams).invite_token;
const { invite_token: inviteToken, next = '' } = await searchParams;
const signUpPath =
pathsConfig.auth.signUp +
(inviteToken ? `?invite_token=${inviteToken}` : '');
const paths = {
callback: pathsConfig.auth.callback,
returnPath: next ?? pathsConfig.app.home,
joinTeam: pathsConfig.app.joinTeam,
};
return (
<>
<div className={'flex flex-col items-center gap-1'}>