Skip to content

Commit db73c02

Browse files
session management fix and reload code after a change fix
1 parent 4c52c85 commit db73c02

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.run/DOCKER-DEBUG.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="DOCKER-DEBUG" type="ChromiumRemoteDebugType" factoryName="Chromium Remote" port="9228" restartOnDisconnect="true">
3+
<mapping url="/usr/src/app/digital-form-builder-adapter/runner" local-file="$PROJECT_DIR$/runner" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

runner/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"scss:build": "node compile-scss.js",
1212
"copy-forms": "node copy-form-json.js",
1313
"clean:build": "rm -rf dist",
14-
"dev": "yarn build && yarn start:local",
15-
"start:local": "NODE_ENV=development nodemon --inspect=0.0.0.0:9228 --watch src --ext js,json,ts,html,scss dist/digital-form-builder-adapter/runner/index.js",
14+
"dev": "NODE_ENV=development nodemon --watch src --ext js,json,ts,html,scss --exec 'yarn build && node --inspect=0.0.0.0:9228 dist/digital-form-builder-adapter/runner/index.js'",
1615
"start:server": "node dist/digital-form-builder-adapter/runner/index.js",
1716
"production": "NODE_ENV=production npm run start:server",
1817
"start:test": "NODE_ENV=development npm run start:server",

runner/src/server/services/AdapterCacheService.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ export class AdapterCacheService extends CacheService {
105105
*/
106106
//@ts-ignore
107107
Key(request: HapiRequest, additionalIdentifier?: ADDITIONAL_IDENTIFIER) {
108-
let id = `${request.yar.id}:${request.params.id}`;
109-
108+
let id: string;
109+
if (request.auth && request.auth.credentials && request.auth.credentials.accountId) {
110+
id = `${request.auth.credentials.accountId}:${request.params.id}`;
111+
request.logger.info(`[ACTIVATE-SESSION] get user account id for the session key ${id}`);
112+
} else {
113+
id = `${request.yar.id}:${request.params.id}`;
114+
}
110115
if (request.query.form_session_identifier) {
111116
id = `${id}:${request.query.form_session_identifier}`;
112117
}

0 commit comments

Comments
 (0)