Skip to content

Commit f1f93dd

Browse files
committed
always redirect to full url after login
1 parent a7201e3 commit f1f93dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export function createAuthModule(
5151
return;
5252
}
5353
// If nextUrl is not provided, use the current URL
54-
const redirectUrl = nextUrl || window.location.href;
54+
const redirectUrl = nextUrl
55+
? new URL(nextUrl, window.location.origin).toString()
56+
: window.location.href;
5557

5658
// Build the login URL
5759
const loginUrl = `${

0 commit comments

Comments
 (0)