| 15 | } |
| 16 | }) |
| 17 | export class DiscordProtocol implements OnVerify, OnInstall { |
| 18 | constructor(private authService: AuthService) {} |
| 19 | |
| 20 | async $onVerify(@Req() req: Req, @Args() [accessToken, refreshToken, profile]: any) { |
| 21 | profile.refreshToken = refreshToken; |
| 22 | |
| 23 | const user = await this.authService.findOne({discordId: profile.id}); |
| 24 | |
| 25 | return user ? user : false; |
| 26 | } |
| 27 | |
| 28 | async $onInstall(strategy: Strategy) { |
| 29 | refresh.use(strategy); |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected