| 16 | } |
| 17 | }) |
| 18 | export class FacebookProtocol implements OnVerify, OnInstall { |
| 19 | @Inject() |
| 20 | private authService: AuthService; |
| 21 | |
| 22 | async $onVerify(@Req() req: Req, @Args() [accessToken, refreshToken, profile]: any) { |
| 23 | profile.refreshToken = refreshToken; |
| 24 | |
| 25 | const user = await this.authService.findOne({facebookId: profile.id}); |
| 26 | |
| 27 | return user ? user : false; |
| 28 | } |
| 29 | } |