1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-07 06:30:06 +00:00

feat: mocking sas9 responses with JS STP

This commit is contained in:
2022-10-17 18:31:08 +02:00
parent 6434123401
commit 36be3a7d5e
7 changed files with 96 additions and 114 deletions

View File

@@ -18,10 +18,12 @@ export const getPreProgramVariables = (req: Request): PreProgramVars => {
if (cookies.length) httpHeaders.push(`cookie: ${cookies.join('; ')}`)
//In desktop mode when mocking mode is enabled, user was undefined.
//So this is workaround.
return {
username: user!.username,
userId: user!.userId,
displayName: user!.displayName,
username: user ? user.username : 'demo',
userId: user ? user.userId : 0,
displayName: user ? user.displayName : 'demo',
serverUrl: protocol + host,
httpHeaders
}