Skip to content

Commit 326eadf

Browse files
acoreyjcoreyEntropyThangHuuVu
authored
fix: don't add /error to url pathname when email verification is successful (#6492)
fix handleAuthorized making bad pth when authorize Co-authored-by: Corey Jepperson <[email protected]> Co-authored-by: Thang Vu <[email protected]>
1 parent a5e0db4 commit 326eadf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/lib/routes/shared.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ export async function handleAuthorized(
77
params: any,
88
{ url, logger, callbacks: { signIn } }: InternalOptions
99
) {
10-
url.pathname += "/error"
1110
try {
1211
const authorized = await signIn(params)
1312
if (!authorized) {
13+
url.pathname += "/error"
1414
logger.debug("User not authorized", params)
1515
url.searchParams.set("error", "AccessDenied")
1616
return { status: 403 as const, redirect: url.toString() }
1717
}
1818
} catch (e) {
19+
url.pathname += "/error"
1920
const error = new AuthorizedCallbackError(e as Error)
2021
logger.error(error)
2122
url.searchParams.set("error", "Configuration")

0 commit comments

Comments
 (0)