Skip to content

Commit

Permalink
fix: oidc: don't wish for a refresh token
Browse files Browse the repository at this point in the history
  • Loading branch information
diced committed Jan 20, 2025
1 parent 0caa188 commit 2130d11
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/pages/api/auth/oauth/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ async function handler({ code, host, state }: OAuthQuery, _logger: Logger): Prom

const json = await res.json();
if (!json.access_token) return { error: 'No access token in response' };
if (!json.refresh_token) return { error: 'No refresh token in response' };

const userJson = await oidcAuth.user(json.access_token, config.oauth.oidc.userinfoUrl!);
if (!userJson) return { error: 'Failed to fetch user' };

return {
access_token: json.access_token,
refresh_token: json.refresh_token,
refresh_token: json.refresh_token || null,
username: userJson.preferred_username,
user_id: userJson.sub,
};
Expand Down

0 comments on commit 2130d11

Please sign in to comment.