File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ module.exports = [
32
32
} )
33
33
. then ( ( copilotOpportunity ) => {
34
34
const plainOpportunity = copilotOpportunity . get ( { plain : true } ) ;
35
+ req . log . info ( "authUser" , req . authUser ) ;
35
36
const memberIds = plainOpportunity . project . members . map ( ( member ) => member . userId ) ;
36
37
// This shouldn't be exposed to the clientside
37
38
delete plainOpportunity . project . members ;
Original file line number Diff line number Diff line change @@ -35,9 +35,14 @@ const jwtAuth = require('tc-core-library-js').middleware.jwtAuthenticator;
35
35
router . all (
36
36
RegExp ( `\\/${ apiVersion } \\/(copilots|projects|timelines|orgConfig|customer-payments)(?!\\/health).*` ) ,
37
37
( req , res , next ) => {
38
- if ( publicRoutes . some ( routeRegex => routeRegex . test ( req . path ) ) ) {
38
+ let token
39
+ if ( req . headers . authorization && req . headers . authorization . split ( ' ' ) [ 0 ] === 'Bearer' ) {
40
+ token = req . headers . authorization . split ( ' ' ) [ 1 ]
41
+ }
42
+ if ( publicRoutes . some ( routeRegex => routeRegex . test ( req . path ) ) && ! token ) {
39
43
return next ( ) ;
40
44
}
45
+ req . log . info ( "token available" , token ) ;
41
46
// JWT authentication
42
47
return jwtAuth ( config ) ( req , res , next ) ;
43
48
} ,
You can’t perform that action at this time.
0 commit comments