Skip to content

Commit

Permalink
Merge pull request #330 from Quickchive/fix/use-rs-256
Browse files Browse the repository at this point in the history
fix: decode apple id token
  • Loading branch information
stae1102 authored May 11, 2024
2 parents 00a1647 + 68256d1 commit 8c1f0ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/auth/jwt/jwt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export class customJwtService {
return this.jwtService.verify(token, { secret: options?.secret });
}

decode(token: string): Payload {
return this.jwtService.decode(token) as Payload;
}

createPayload(email: string, autoLogin: boolean, sub: number): Payload {
const period: string = autoLogin ? ONEYEAR : ONEDAY;

Expand Down
2 changes: 1 addition & 1 deletion src/auth/oauth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class OAuthService {
);
}

const { sub: id, email } = this.jwtService.verify(data.id_token);
const { sub: id, email } = this.jwtService.decode(data.id_token);

let user = await this.userRepository.findOneByEmail(email);

Expand Down

0 comments on commit 8c1f0ae

Please sign in to comment.