@thunderid/express 0.1.0 → 0.2.3

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.
@@ -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
  };
@@ -339,7 +339,7 @@ const handleFlow = () => {
339
339
  const authUrl = await client.getSignInUrl();
340
340
  resolvedAuthId = new URL(authUrl).searchParams.get("authId") ?? void 0;
341
341
  }
342
- const flowResponse = await (0, __thunderid_node.executeEmbeddedSignInFlowV2)({
342
+ const flowResponse = await (0, __thunderid_node.executeEmbeddedSignInFlow)({
343
343
  authId: resolvedAuthId,
344
344
  baseUrl,
345
345
  payload: executionId ? {
@@ -1,4 +1,4 @@
1
- import { ThunderIDAuthException, ThunderIDNodeClient, ThunderIDRuntimeError, executeEmbeddedSignInFlowV2, logger } from "@thunderid/node";
1
+ import { ThunderIDAuthException, ThunderIDNodeClient, ThunderIDRuntimeError, executeEmbeddedSignInFlow, logger } from "@thunderid/node";
2
2
  import { v4 } from "uuid";
3
3
 
4
4
  export * from "@thunderid/node"
@@ -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
  };
@@ -316,7 +316,7 @@ const handleFlow = () => {
316
316
  const authUrl = await client.getSignInUrl();
317
317
  resolvedAuthId = new URL(authUrl).searchParams.get("authId") ?? void 0;
318
318
  }
319
- const flowResponse = await executeEmbeddedSignInFlowV2({
319
+ const flowResponse = await executeEmbeddedSignInFlow({
320
320
  authId: resolvedAuthId,
321
321
  baseUrl,
322
322
  payload: executionId ? {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ThunderIDAuthException, ThunderIDNodeClient, ThunderIDRuntimeError, executeEmbeddedSignInFlowV2, logger } from "@thunderid/node";
1
+ import { ThunderIDAuthException, ThunderIDNodeClient, ThunderIDRuntimeError, executeEmbeddedSignInFlow, logger } from "@thunderid/node";
2
2
  import { v4 } from "uuid";
3
3
 
4
4
  export * from "@thunderid/node"
@@ -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
  };
@@ -316,7 +316,7 @@ const handleFlow = () => {
316
316
  const authUrl = await client.getSignInUrl();
317
317
  resolvedAuthId = new URL(authUrl).searchParams.get("authId") ?? void 0;
318
318
  }
319
- const flowResponse = await executeEmbeddedSignInFlowV2({
319
+ const flowResponse = await executeEmbeddedSignInFlow({
320
320
  authId: resolvedAuthId,
321
321
  baseUrl,
322
322
  payload: executionId ? {
@@ -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,13 +1,13 @@
1
1
  {
2
2
  "name": "@thunderid/express",
3
- "version": "0.1.0",
3
+ "version": "0.2.3",
4
4
  "description": "Express.js SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
7
7
  "express.js",
8
8
  "server"
9
9
  ],
10
- "homepage": "https://github.com/thunder-id/thunderid/tree/main/sdks/express#readme",
10
+ "homepage": "https://github.com/thunder-id/javascript-sdks/tree/main/packages/express#readme",
11
11
  "bugs": {
12
12
  "url": "https://github.com/thunder-id/thunderid/issues"
13
13
  },
@@ -29,10 +29,14 @@
29
29
  "types": "dist/index.d.ts",
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/thunder-id/thunderid",
33
- "directory": "sdks/express"
32
+ "url": "https://github.com/thunder-id/javascript-sdks",
33
+ "directory": "packages/express"
34
34
  },
35
35
  "devDependencies": {
36
+ "@thunderid/eslint-plugin": "0.0.2",
37
+ "@thunderid/prettier-config": "0.0.2",
38
+ "@types/cookie-parser": "^1.4.8",
39
+ "@types/express": "^5.0.6",
36
40
  "@types/node": "22.15.3",
37
41
  "eslint": "9.39.4",
38
42
  "express": "5.2.1",
@@ -40,13 +44,11 @@
40
44
  "rimraf": "6.1.3",
41
45
  "rolldown": "1.0.0-beta.45",
42
46
  "typescript": "5.9.3",
43
- "vitest": "4.1.3",
44
- "@thunderid/eslint-plugin": "^0.0.0",
45
- "@thunderid/prettier-config": "^0.0.0"
47
+ "vitest": "4.1.8"
46
48
  },
47
49
  "dependencies": {
48
50
  "uuid": "11.1.1",
49
- "@thunderid/node": "^0.1.0"
51
+ "@thunderid/node": "^0.2.1"
50
52
  },
51
53
  "peerDependencies": {
52
54
  "express": ">=4.21.2"