File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,13 @@ https://www.npmjs.com/package/@sap/xssec#testing
3737function buildMockAuthMiddleware ( ) {
3838 return async function mockAuthentication ( req , res , next ) {
3939 const basicAuthUser = req . headers [ 'authorization' ] ?. split ( ' ' ) [ 1 ] ;
40- if ( ! basicAuthUser ) {
40+ const user = Buffer . from ( basicAuthUser , 'base64' ) . toString ( ) . split ( ':' ) [ 0 ] ;
41+ const [ username , api ] = user . split ( '|' ) ;
42+
43+ if ( ! username ) {
4144 return res . sendStatus ( 401 ) ;
4245 }
4346
44- const user = Buffer . from ( basicAuthUser , 'base64' ) . toString ( ) . split ( ':' ) [ 0 ] ;
45- const [ username , api ] = user . split ( '|' ) ;
4647 const mockPayload = {
4748 app_tid : "default" ,
4849 scim_id : username ,
Original file line number Diff line number Diff line change 1+ const { AMS_AUTHORIZATIONS } = require ( "@sap/ams" ) ;
2+
13/**
24 * Returns the potential privileges of the user to determine which UI elements to show.
35 * @param {import("@sap/ams").AuthorizedRequest } req
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ <h1>AMS Shopping Application</h1>
1616 < option value ="alice "> alice</ option >
1717 < option value ="bob "> bob</ option >
1818 < option value ="carol "> carol</ option >
19- < option value ="none "> none</ option >
19+ < option value =""> none</ option >
2020 </ select >
2121 < label for ="external-api-checkbox "> ExternalOrder (order total < 100 ) </ label >
2222 < input type ="checkbox " id ="external-api-checkbox ">
You can’t perform that action at this time.
0 commit comments