MCPcopy
hub / github.com/tsedio/tsed / DiscordProtocol

Class DiscordProtocol

docs/tutorials/snippets/passport/DiscordProtocol.ts:17–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 }
16})
17export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected