diff --git a/package.json b/package.json index 0fa1d07..7a3a4be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@janishutz/login-sdk-server-stubs", - "version": "1.0.1", + "version": "1.4.0", "description": "Server side client stubs for janishutz.com account service", "main": "index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index 24479c4..2780ce6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,7 +48,7 @@ const getSignedIn = ( _request: express.Request ): boolean => { * @returns The extra data you stored */ const getExtraSessionData = ( request: express.Request ): object => { - return request.session.otherData; + return request.session.otherData ?? {}; }; diff --git a/tsconfig.json b/tsconfig.json index 503cfa6..fc89d6a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,18 @@ { - "compilerOptions": { - "outDir": "./dist", - "allowJs": true, - "target": "ES6", - "skipLibCheck": true, - "allowSyntheticDefaultImports": true, - "types": ["node"], - "module": "NodeNext", - "moduleResolution": "NodeNext" - }, - "include": [ "./src/**/*" ], -} \ No newline at end of file + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "allowJs": true, + "target": "ES6", + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "types": [ + "node" + ], + "module": "NodeNext", + "moduleResolution": "NodeNext" + }, + "include": [ + "./src/**/*" + ] +}