Skip to content

Commit beb8e0d

Browse files
committed
fix auth redirects
1 parent 688ae2e commit beb8e0d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/server/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function authenticate(): never {
1212
"?" +
1313
new URLSearchParams({
1414
client_id: env.AUTH_CLIENT_ID,
15-
redirect_uri: env.AUTH_REDIRECT_URI,
15+
redirect_uri: new URL("/api/auth", env.AUTH_REDIRECT_URI).toString(),
1616
}).toString(),
1717
env.AUTH_ENDPOINT,
1818
).toString(),
@@ -105,7 +105,7 @@ export async function handleOAuthRedirect(request: NextRequest) {
105105
client_secret: env.AUTH_CLIENT_SECRET,
106106
code: code,
107107
grant_type: "authorization_code",
108-
redirect_uri: env.AUTH_REDIRECT_URI,
108+
redirect_uri: new URL("/api/auth", env.AUTH_REDIRECT_URI).toString(),
109109
}).toString(),
110110
})
111111
.then((res) => res.json())

0 commit comments

Comments
 (0)