@thunderid/express 0.0.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![ThunderID Express SDK](https://raw.githubusercontent.com/thunder-id/thunderid/refs/heads/main/docs/content/sdks/assets/images/%40thunderid%3Aexpress_sdk_banner.png)
1
+ ![ThunderID Express SDK](https://raw.githubusercontent.com/thunder-id/thunderid/refs/heads/main/docs/static/assets/images/readme/repo-banner-express-sdk.png)
2
2
 
3
3
  Express.js SDK for ThunderID. Provides authentication middleware for Express applications.
4
4
 
@@ -117,7 +117,7 @@ var ThunderIDExpressClient = class extends __thunderid_node.ThunderIDNodeClient
117
117
  res.redirect(url);
118
118
  if (typeof next === "function") next();
119
119
  };
120
- const authResponse = await super.signIn(authRedirectCallback, userId, req.query.code, req.query.session_state, req.query.state, signInConfig);
120
+ const authResponse = await super.signIn(authRedirectCallback, userId, req.query["code"], req.query["session_state"], req.query["state"], signInConfig);
121
121
  if (authResponse.accessToken || authResponse.idToken) return authResponse;
122
122
  return {
123
123
  accessToken: "",
@@ -281,7 +281,7 @@ const protect = (onUnauthenticated) => {
281
281
  reject();
282
282
  return;
283
283
  }
284
- if (await client.isSignedIn(sessionId)) return next();
284
+ if (await client.isSignedIn(sessionId) ?? false) return next();
285
285
  __thunderid_node.logger.error("Invalid session ID found in the request cookies");
286
286
  reject();
287
287
  };
@@ -94,7 +94,7 @@ var ThunderIDExpressClient = class extends ThunderIDNodeClient {
94
94
  res.redirect(url);
95
95
  if (typeof next === "function") next();
96
96
  };
97
- const authResponse = await super.signIn(authRedirectCallback, userId, req.query.code, req.query.session_state, req.query.state, signInConfig);
97
+ const authResponse = await super.signIn(authRedirectCallback, userId, req.query["code"], req.query["session_state"], req.query["state"], signInConfig);
98
98
  if (authResponse.accessToken || authResponse.idToken) return authResponse;
99
99
  return {
100
100
  accessToken: "",
@@ -258,7 +258,7 @@ const protect = (onUnauthenticated) => {
258
258
  reject();
259
259
  return;
260
260
  }
261
- if (await client.isSignedIn(sessionId)) return next();
261
+ if (await client.isSignedIn(sessionId) ?? false) return next();
262
262
  logger.error("Invalid session ID found in the request cookies");
263
263
  reject();
264
264
  };
package/dist/index.js CHANGED
@@ -94,7 +94,7 @@ var ThunderIDExpressClient = class extends ThunderIDNodeClient {
94
94
  res.redirect(url);
95
95
  if (typeof next === "function") next();
96
96
  };
97
- const authResponse = await super.signIn(authRedirectCallback, userId, req.query.code, req.query.session_state, req.query.state, signInConfig);
97
+ const authResponse = await super.signIn(authRedirectCallback, userId, req.query["code"], req.query["session_state"], req.query["state"], signInConfig);
98
98
  if (authResponse.accessToken || authResponse.idToken) return authResponse;
99
99
  return {
100
100
  accessToken: "",
@@ -258,7 +258,7 @@ const protect = (onUnauthenticated) => {
258
258
  reject();
259
259
  return;
260
260
  }
261
- if (await client.isSignedIn(sessionId)) return next();
261
+ if (await client.isSignedIn(sessionId) ?? false) return next();
262
262
  logger.error("Invalid session ID found in the request cookies");
263
263
  reject();
264
264
  };
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,GAAI,QAAQ,sBAAsB,KAAG,OAAO,CAAC,cAsB3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,YAAY,QAAO,OAAO,CAAC,cA6BhC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,aAAa,QAAO,OAAO,CAAC,cAgDjC,CAAC;AAEF,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAC,CAAC"}
1
+ {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAGxD;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,GAAI,QAAQ,sBAAsB,KAAG,OAAO,CAAC,cAsB3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,YAAY,QAAO,OAAO,CAAC,cA6BhC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,aAAa,QAAO,OAAO,CAAC,cA4CjC,CAAC;AAEF,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunderid/express",
3
- "version": "0.0.5",
3
+ "version": "0.2.0",
4
4
  "description": "Express.js SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
@@ -33,6 +33,8 @@
33
33
  "directory": "sdks/express"
34
34
  },
35
35
  "devDependencies": {
36
+ "@types/cookie-parser": "^1.4.8",
37
+ "@types/express": "^5.0.6",
36
38
  "@types/node": "22.15.3",
37
39
  "eslint": "9.39.4",
38
40
  "express": "5.2.1",
@@ -40,13 +42,13 @@
40
42
  "rimraf": "6.1.3",
41
43
  "rolldown": "1.0.0-beta.45",
42
44
  "typescript": "5.9.3",
43
- "vitest": "4.1.3",
45
+ "vitest": "4.1.8",
44
46
  "@thunderid/eslint-plugin": "^0.0.0",
45
47
  "@thunderid/prettier-config": "^0.0.0"
46
48
  },
47
49
  "dependencies": {
48
- "uuid": "11.1.0",
49
- "@thunderid/node": "^0.0.6"
50
+ "uuid": "11.1.1",
51
+ "@thunderid/node": "^0.2.0"
50
52
  },
51
53
  "peerDependencies": {
52
54
  "express": ">=4.21.2"
@@ -55,8 +57,10 @@
55
57
  "access": "public"
56
58
  },
57
59
  "scripts": {
58
- "build": "pnpm clean && rolldown -c rolldown.config.js && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
59
- "clean": "rimraf dist",
60
+ "build": "pnpm clean:dist && rolldown -c rolldown.config.js && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
61
+ "clean": "pnpm clean:node_modules && pnpm clean:dist",
62
+ "clean:dist": "rimraf dist",
63
+ "clean:node_modules": "rimraf node_modules",
60
64
  "format:check": "prettier --check --cache .",
61
65
  "format:fix": "prettier --write --cache .",
62
66
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",