File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ # lambda-authorizer-client
2
+
3
+ Lambda authorizer which validates JWT signature and claims. Specific to client ordering flow.
4
+
5
+ Part of a group course project of a self service and kitchen management system for a fictional fast food restaurant.
Original file line number Diff line number Diff line change @@ -29,14 +29,14 @@ exports.handler = async (event) => {
29
29
jwtSettings . options
30
30
) ;
31
31
32
- if ( decoded . sub == null ) {
33
- console . log ( 'Missing sub claim' ) ;
32
+ if ( ! decoded . sub || ! Number ( decoded . sub ) ) {
33
+ console . log ( 'Missing or invalid sub claim' ) ;
34
34
return { isAuthorized : false } ;
35
35
}
36
36
37
37
return { isAuthorized : true } ;
38
38
} catch ( error ) {
39
- console . log ( 'Token validation failed' , token ) ;
39
+ console . log ( 'Token verification failed' , token ) ;
40
40
return { isAuthorized : false } ;
41
41
}
42
42
} ;
You can’t perform that action at this time.
0 commit comments