Invite prefill email (#43)

* Add prepopulation of email field in sign-up form
* Updated packages
This commit is contained in:
Giancarlo Buomprisco
2024-07-11 13:59:14 +08:00
committed by GitHub
parent 4f0e6b9bbb
commit 21f42f14ce
24 changed files with 151 additions and 85 deletions

View File

@@ -20,6 +20,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
interface Context {
searchParams: {
invite_token?: string;
email?: string;
};
}
@@ -46,9 +47,15 @@ async function JoinTeamAccountPage({ searchParams }: Context) {
// redirect to the sign up page with the invite token
// so that they will get back to this page after signing up
if (auth.error ?? !auth.data) {
const path = `${pathsConfig.auth.signUp}?invite_token=${token}`;
const urlParams = new URLSearchParams({
invite_token: token,
email: searchParams.email ?? '',
});
redirect(path);
const signUpPath = `${pathsConfig.auth.signUp}?${urlParams.toString()}`;
// redirect to the sign up page with the invite token
redirect(signUpPath);
}
// get api to interact with team accounts

View File

@@ -52,11 +52,11 @@
"@kit/ui": "workspace:^",
"@makerkit/data-loader-supabase-core": "^0.0.8",
"@makerkit/data-loader-supabase-nextjs": "^1.2.3",
"@marsidev/react-turnstile": "^0.7.1",
"@marsidev/react-turnstile": "^0.7.2",
"@radix-ui/react-icons": "^1.3.0",
"@supabase/supabase-js": "^2.44.3",
"@tanstack/react-query": "5.50.1",
"@tanstack/react-query-next-experimental": "^5.50.1",
"@tanstack/react-query": "5.51.1",
"@tanstack/react-query-next-experimental": "^5.51.1",
"@tanstack/react-table": "^8.19.2",
"date-fns": "^3.6.0",
"lucide-react": "^0.407.0",