-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "✨ [Feature] Google OAuth login (#604)"
This reverts commit 59ae80e.
- Loading branch information
Showing
24 changed files
with
99 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { Injectable, CanActivate, ExecutionContext, InternalServerErrorException, Logger } from '@nestjs/common'; | ||
import { AuthGuard } from '@nestjs/passport'; | ||
import { Observable } from 'rxjs'; | ||
|
||
@Injectable() | ||
export class FtGuard extends AuthGuard('ft') {} | ||
export class FtGuard extends AuthGuard('ft') implements CanActivate { | ||
constructor() { | ||
super(); | ||
} | ||
logger: Logger = new Logger('FtGuard'); | ||
|
||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> { | ||
const maxRetries = 5; | ||
|
||
for (let retry = 0; retry < maxRetries; ++retry) { | ||
try { | ||
this.logger.log('FtGuard canActivate() try:', retry); | ||
return super.canActivate(context); | ||
} catch (err) { | ||
// do nothing | ||
this.logger.error('FtGuard canActivate() error:', err); | ||
} | ||
} | ||
throw new InternalServerErrorException('Max retries exceeded. Unable to activate guard.'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.