Skip to content

Commit

Permalink
fix: redirect url
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalaforge committed Mar 29, 2024
1 parent c467589 commit 722ccc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/src/pages/auth/authorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export async function GET({url, redirect}) {

const myUrl = new URL(url);
const params = new URLSearchParams(myUrl.search);
const redirect_uri = params.get('redirect_uri');
const redirectUrl = params.get('redirect_uri');

const { GITHUB_CLIENT_ID } = import.meta.env;

const state = toHexString(redirect_uri);

const redirect_uri = `${myUrl.origin}/auth/authorized`
const state = toHexString(redirectUrl);

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

0 comments on commit 722ccc0

Please sign in to comment.