mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 02:01:10 +02:00
fix(mana-auth): set callbackURL instead of redirectTo for email verification redirect
Better Auth uses callbackURL to determine the post-verification redirect target. Setting only redirectTo left callbackURL=/ which resolved to auth.mana.how/ (404). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8e1601076f
commit
d23ef52839
1 changed files with 3 additions and 2 deletions
|
|
@ -188,11 +188,12 @@ export function createBetterAuth(databaseUrl: string) {
|
|||
// during the verification process in the passthrough controller
|
||||
const sourceAppUrl = sourceAppStore.get(user.email);
|
||||
|
||||
// Modify verification URL to include redirectTo parameter
|
||||
// Modify verification URL: set callbackURL so Better Auth redirects
|
||||
// back to the source app after email verification
|
||||
let verificationUrl = url;
|
||||
if (sourceAppUrl) {
|
||||
const urlObj = new URL(url);
|
||||
urlObj.searchParams.set('redirectTo', sourceAppUrl);
|
||||
urlObj.searchParams.set('callbackURL', sourceAppUrl);
|
||||
verificationUrl = urlObj.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue