Skip to content

Commit

Permalink
fix: fix social auth state check
Browse files Browse the repository at this point in the history
  • Loading branch information
prisca-c committed Oct 28, 2024
1 parent f9c2673 commit b3838cb
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/features/auth/contracts/social_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ export class SocialAuth {
providerId: 1,
})
} else if (socialProvider) {
switch (socialProvider.state()) {
case socialProvider.accessDenied():
return this.responseService.handle(SocialAuthStateEnum.ACCESS_DENIED, null)
case socialProvider.stateMisMatch():
return this.responseService.handle(SocialAuthStateEnum.STATE_MISMATCH, null)
case socialProvider.hasError():
return this.responseService.handle(SocialAuthStateEnum.ERROR, null)
if (socialProvider.accessDenied()) {
return this.responseService.handle(SocialAuthStateEnum.ACCESS_DENIED, null)
}

if (socialProvider.stateMisMatch()) {
return this.responseService.handle(SocialAuthStateEnum.STATE_MISMATCH, null)
}

if (socialProvider.hasError()) {
return this.responseService.handle(SocialAuthStateEnum.ERROR, null)
}

const socialUser = await socialProvider.user()
Expand Down

0 comments on commit b3838cb

Please sign in to comment.