File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ import { JwtFromRequestFunction } from 'passport-jwt';
2
2
3
3
export interface FirebaseAuthStrategyOptions {
4
4
extractor : JwtFromRequestFunction ;
5
+ checkRevoked ?: boolean ;
5
6
}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import * as admin from 'firebase-admin';
10
10
11
11
export class FirebaseAuthStrategy extends Strategy {
12
12
readonly name = FIREBASE_AUTH ;
13
+ private checkRevoked = false ;
13
14
14
15
constructor (
15
16
options : FirebaseAuthStrategyOptions ,
@@ -23,6 +24,7 @@ export class FirebaseAuthStrategy extends Strategy {
23
24
}
24
25
25
26
this . extractor = options . extractor ;
27
+ this . checkRevoked = options . checkRevoked ;
26
28
}
27
29
28
30
async validate ( payload : FirebaseUser ) : Promise < any > {
@@ -40,7 +42,7 @@ export class FirebaseAuthStrategy extends Strategy {
40
42
41
43
try {
42
44
admin . auth ( )
43
- . verifyIdToken ( idToken )
45
+ . verifyIdToken ( idToken , this . checkRevoked )
44
46
. then ( ( res ) => this . validateDecodedIdToken ( res ) )
45
47
. catch ( ( err ) => {
46
48
this . fail ( { err } , 401 ) ;
You can’t perform that action at this time.
0 commit comments