diff --git a/.npmignore b/.npmignore index a50451d..d5caa73 100644 --- a/.npmignore +++ b/.npmignore @@ -1,8 +1,2 @@ -Makefile -docs/ -examples/ -reports/ -test/ - -.jshintrc -.travis.yml +.* +src/ diff --git a/package-lock.json b/package-lock.json index e489a62..6980707 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "passport-affinidi", - "version": "0.0.7", + "version": "0.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "passport-affinidi", - "version": "0.0.7", + "version": "0.0.8", "license": "MIT", "dependencies": { "express-session": "^1.17.3", diff --git a/package.json b/package.json index ad081ce..de2bc91 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,12 @@ { "name": "passport-affinidi", - "version": "0.0.7", + "version": "0.0.8", "description": "Affinidi (OAuth 2.0) authentication provider using passport and open-connect", "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "/dist" + ], "scripts": { "build": "shx rm -rf dist && tsc -b", "lint": "eslint . --ext .ts", @@ -50,6 +54,6 @@ "node": ">= 0.4.0" }, "directories": { - "lib": "lib" + "lib": "dist" } } diff --git a/src/index.ts b/src/index.ts index 93cf8c6..e5b17fa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,8 +37,8 @@ export const affinidiProvider = async (app: any, options: ProviderOptionsType) = resave: false, saveUninitialized: true, cookie: { - secure: process.env.NODE_ENV === 'production', // Crucial - maxAge: 1000 * 60 * 60 * 24 * 1, // 30 days + secure: process.env.NODE_ENV === 'production', + maxAge: 1000 * 60 * 60 * 24 * 1, // 1 day }, unset: 'destroy', ...options.expressSesssion, diff --git a/src/strategy.ts b/src/strategy.ts index a827a21..567753f 100644 --- a/src/strategy.ts +++ b/src/strategy.ts @@ -14,7 +14,7 @@ export default async function AffinidiStrategy(options: ProviderOptionsType) { //discover the wellknown for issuer const affinidi = await Issuer.discover(options.issuer) - console.log('Discovered issuer %s %O', affinidi.issuer, affinidi.metadata) + //console.log('Discovered issuer %s %O', affinidi.issuer, affinidi.metadata) const sessionKey = `oidc:${options.id || 'affinidi'}-session-key` var client = new affinidi.Client({ diff --git a/tsconfig.json b/tsconfig.json index 25d328e..b9e3e95 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { - "module": "Node16", + "module": "commonjs", + "moduleResolution": "node", "outDir": "dist", "rootDir": "src", "target": "ES2020", - "moduleResolution": "Node16", "declaration": true, "importHelpers": true, "esModuleInterop": true,