mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fixed email url bug
This commit is contained in:
parent
27805d8dfb
commit
3e181bcb86
@ -105,7 +105,7 @@ export const POST = smartRouteHandler(async (req: NextRequest) => {
|
||||
throw new KnownError(RedirectUrlInvalidErrorCode);
|
||||
}
|
||||
|
||||
await sendVerificationEmail(projectId, newUser.projectUserId, emailVerificationRedirectUrl,);
|
||||
await sendVerificationEmail(projectId, newUser.projectUserId, emailVerificationRedirectUrl);
|
||||
|
||||
return NextResponse.json({
|
||||
access_token: accessToken,
|
||||
|
||||
@ -128,9 +128,12 @@ export async function sendVerificationEmail(
|
||||
}
|
||||
});
|
||||
|
||||
const verificationUrl = new URL(redirectUrl);
|
||||
verificationUrl.searchParams.append('code', verificationCode.code);
|
||||
|
||||
const html = render(
|
||||
<VerificationEmail
|
||||
verificationUrl={`${getEnvVariable('NEXT_PUBLIC_STACK_URL')}/api/v1/auth/verify-email?code=${verificationCode.code}`}
|
||||
verificationUrl={verificationUrl.toString()}
|
||||
projectName={project.displayName}
|
||||
username={projectUser.displayName || undefined}
|
||||
fromStack={emailConfig.type === 'shared'}
|
||||
|
||||
@ -139,12 +139,12 @@ export async function signUpWithCredential(
|
||||
email,
|
||||
password,
|
||||
redirectUrl,
|
||||
emailVerificationRedirectUrl = "/"
|
||||
emailVerificationRedirectUrl,
|
||||
}: {
|
||||
email: string,
|
||||
password: string,
|
||||
redirectUrl?: string,
|
||||
emailVerificationRedirectUrl?: string,
|
||||
emailVerificationRedirectUrl: string,
|
||||
}
|
||||
): Promise<SignUpErrorCode | undefined>{
|
||||
emailVerificationRedirectUrl = constructRedirectUrl(emailVerificationRedirectUrl);
|
||||
|
||||
@ -539,7 +539,10 @@ class _StackClientAppImpl<HasTokenStore extends boolean, ProjectId extends strin
|
||||
}
|
||||
this._ensurePersistentTokenStore();
|
||||
const tokenStore = getTokenStore(this._tokenStoreOptions);
|
||||
return await signUpWithCredential(this._interface, tokenStore, options);
|
||||
return await signUpWithCredential(this._interface, tokenStore, {
|
||||
...options,
|
||||
emailVerificationRedirectUrl: this.urls.emailVerification,
|
||||
});
|
||||
}
|
||||
|
||||
async callOAuthCallback(options: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user