Skip to content

Commit

Permalink
Update oauth-handle-redirect.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
severo authored Dec 5, 2024
1 parent c328145 commit 5a8c636
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/hub/src/lib/oauth-handle-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ export async function oauthHandleRedirect(opts?: { hubUrl?: string }): Promise<O
throw await createApiError(openidConfigRes);
}

const opendidConfig: {
const openidConfig: {
authorization_endpoint: string;
token_endpoint: string;
userinfo_endpoint: string;
} = await openidConfigRes.json();

const tokenRes = await fetch(opendidConfig.token_endpoint, {
const tokenRes = await fetch(openidConfig.token_endpoint, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Expand Down Expand Up @@ -137,7 +137,7 @@ export async function oauthHandleRedirect(opts?: { hubUrl?: string }): Promise<O

const accessTokenExpiresAt = new Date(Date.now() + token.expires_in * 1000);

const userInfoRes = await fetch(opendidConfig.userinfo_endpoint, {
const userInfoRes = await fetch(openidConfig.userinfo_endpoint, {
headers: {
Authorization: `Bearer ${token.access_token}`,
},
Expand Down

0 comments on commit 5a8c636

Please sign in to comment.