Skip to content

Commit 722ccc0

Browse files
committed
fix: redirect url
1 parent c467589 commit 722ccc0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/src/pages/auth/authorize.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export async function GET({url, redirect}) {
88

99
const myUrl = new URL(url);
1010
const params = new URLSearchParams(myUrl.search);
11-
const redirect_uri = params.get('redirect_uri');
11+
const redirectUrl = params.get('redirect_uri');
1212

1313
const { GITHUB_CLIENT_ID } = import.meta.env;
1414

15-
const state = toHexString(redirect_uri);
15+
16+
const redirect_uri = `${myUrl.origin}/auth/authorized`
17+
const state = toHexString(redirectUrl);
1618

1719
const oauthParams = new URLSearchParams({ client_id:GITHUB_CLIENT_ID , redirect_uri, state });
1820
return redirect(`${GITHUB_OAUTH_AUTHORIZE_URL}?${oauthParams}`, 302)

0 commit comments

Comments
 (0)