File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ workflows:
82
82
- " build-dev " :
83
83
filters :
84
84
branches :
85
- only : ['dev']
85
+ only : ['dev','feature/m2mtoken-support' ]
86
86
- " build-prod " :
87
87
filters :
88
88
branches :
Original file line number Diff line number Diff line change @@ -192,10 +192,9 @@ function validateEventPayload (event) {
192
192
function verifyTokenScope ( req , scope ) {
193
193
const isMachineToken = _ . get ( req , 'authUser.isMachine' , false ) ;
194
194
const scopes = _ . get ( req , 'authUser.scopes' , [ ] ) ;
195
- if ( isMachineToken && ( _ . indexOf ( scopes , scope ) >= 0 ) ) {
196
- return true ;
195
+ if ( isMachineToken && ! ( _ . indexOf ( scopes , scope ) >= 0 ) ) {
196
+ throw createError . Unauthorized ( "Check your token scope." )
197
197
}
198
- throw createError . Unauthorized ( "Check your token scope." )
199
198
}
200
199
201
200
module . exports = {
You can’t perform that action at this time.
0 commit comments