Skip to content

Commit 37e8b08

Browse files
committed
fix: Add error handling for missing id_token in OAuthService
1 parent 017ac1c commit 37e8b08

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/core/OAuthService/OAuthService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ export class OAuthService {
243243
{ ...result, web3AuthNetwork },
244244
this.config.authServerUrl,
245245
);
246+
if (!data.id_token) {
247+
throw new OAuthError('No token found', OAuthErrorType.LoginError);
248+
}
246249
getAuthTokensSuccess = true;
247250
} catch (error) {
248251
const errorMessage =
@@ -271,10 +274,6 @@ export class OAuthService {
271274
});
272275
}
273276

274-
if (!data.id_token) {
275-
throw new OAuthError('No token found', OAuthErrorType.LoginError);
276-
}
277-
278277
const jwtPayload = JSON.parse(
279278
loginHandler.decodeIdToken(data.id_token),
280279
) as Partial<OAuthUserInfo>;

0 commit comments

Comments
 (0)