@aura-stack/auth 0.2.0 → 0.3.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.
Files changed (76) hide show
  1. package/dist/@types/index.d.ts +3 -2
  2. package/dist/@types/router.d.d.ts +3 -2
  3. package/dist/actions/callback/access-token.cjs +52 -41
  4. package/dist/actions/callback/access-token.d.ts +5 -4
  5. package/dist/actions/callback/access-token.js +3 -2
  6. package/dist/actions/callback/callback.cjs +69 -52
  7. package/dist/actions/callback/callback.d.ts +4 -3
  8. package/dist/actions/callback/callback.js +6 -5
  9. package/dist/actions/callback/userinfo.cjs +54 -43
  10. package/dist/actions/callback/userinfo.d.ts +3 -2
  11. package/dist/actions/callback/userinfo.js +3 -2
  12. package/dist/actions/csrfToken/csrfToken.cjs +2 -2
  13. package/dist/actions/csrfToken/csrfToken.js +2 -2
  14. package/dist/actions/index.cjs +93 -71
  15. package/dist/actions/index.d.ts +3 -2
  16. package/dist/actions/index.js +15 -14
  17. package/dist/actions/session/session.js +2 -2
  18. package/dist/actions/signIn/authorization.cjs +40 -40
  19. package/dist/actions/signIn/authorization.d.ts +3 -2
  20. package/dist/actions/signIn/authorization.js +2 -2
  21. package/dist/actions/signIn/signIn.cjs +63 -50
  22. package/dist/actions/signIn/signIn.d.ts +4 -3
  23. package/dist/actions/signIn/signIn.js +4 -3
  24. package/dist/actions/signOut/signOut.cjs +66 -66
  25. package/dist/actions/signOut/signOut.js +4 -4
  26. package/dist/assert.d.ts +3 -2
  27. package/dist/{chunk-2RXNXMCZ.js → chunk-3EUWD5BB.js} +15 -7
  28. package/dist/{chunk-NEVKX6K2.js → chunk-A3N4PVAT.js} +3 -3
  29. package/dist/chunk-B737EUJV.js +22 -0
  30. package/dist/{chunk-7H3OR6UU.js → chunk-EMKJA2GJ.js} +18 -10
  31. package/dist/{chunk-4V4JNXVF.js → chunk-GA2SMTJO.js} +9 -6
  32. package/dist/chunk-HP34YGGJ.js +22 -0
  33. package/dist/{chunk-QDO2KSRJ.js → chunk-HT4YLL7N.js} +1 -1
  34. package/dist/{chunk-ZLR3LI6X.js → chunk-IVET23KF.js} +7 -4
  35. package/dist/{chunk-PTJUYB33.js → chunk-JVFTCTTE.js} +1 -1
  36. package/dist/{chunk-UEH3LVON.js → chunk-KSWLO5ZU.js} +21 -16
  37. package/dist/{chunk-QEZL7EYN.js → chunk-N4SX7TZT.js} +3 -3
  38. package/dist/{chunk-IMICRJ5U.js → chunk-W6LG7BFW.js} +14 -14
  39. package/dist/{chunk-WD7AUHQ5.js → chunk-YRCB5FLE.js} +8 -8
  40. package/dist/chunk-ZNCZVF6U.js +14 -0
  41. package/dist/cookie.cjs +14 -14
  42. package/dist/cookie.d.ts +3 -2
  43. package/dist/cookie.js +1 -1
  44. package/dist/errors.d.ts +3 -2
  45. package/dist/{index-EqsoyjrF.d.ts → index-DkaLJFn8.d.ts} +57 -8
  46. package/dist/index.cjs +155 -93
  47. package/dist/index.d.ts +4 -3
  48. package/dist/index.js +20 -17
  49. package/dist/jose.cjs +2 -2
  50. package/dist/oauth/bitbucket.d.ts +3 -2
  51. package/dist/oauth/discord.d.ts +3 -2
  52. package/dist/oauth/figma.d.ts +3 -2
  53. package/dist/oauth/github.d.ts +3 -2
  54. package/dist/oauth/gitlab.d.ts +3 -2
  55. package/dist/oauth/index.cjs +85 -41
  56. package/dist/oauth/index.d.ts +3 -2
  57. package/dist/oauth/index.js +16 -8
  58. package/dist/oauth/mailchimp.cjs +46 -0
  59. package/dist/oauth/mailchimp.d.ts +7 -0
  60. package/dist/oauth/mailchimp.js +6 -0
  61. package/dist/oauth/pinterest.cjs +46 -0
  62. package/dist/oauth/pinterest.d.ts +7 -0
  63. package/dist/oauth/pinterest.js +6 -0
  64. package/dist/oauth/spotify.d.ts +3 -2
  65. package/dist/oauth/strava.d.ts +3 -2
  66. package/dist/oauth/x.d.ts +3 -2
  67. package/dist/request.cjs +38 -0
  68. package/dist/request.d.ts +13 -0
  69. package/dist/request.js +6 -0
  70. package/dist/schemas.cjs +40 -40
  71. package/dist/schemas.d.ts +15 -15
  72. package/dist/schemas.js +1 -1
  73. package/dist/secure.cjs +5 -5
  74. package/dist/secure.d.ts +3 -2
  75. package/dist/utils.d.ts +3 -3
  76. package/package.json +6 -4
package/dist/secure.cjs CHANGED
@@ -38,7 +38,7 @@ __export(secure_exports, {
38
38
  verifyCSRF: () => verifyCSRF
39
39
  });
40
40
  module.exports = __toCommonJS(secure_exports);
41
- var import_node_crypto = __toESM(require("crypto"), 1);
41
+ var import_crypto = __toESM(require("crypto"), 1);
42
42
 
43
43
  // src/utils.ts
44
44
  var import_router = require("@aura-stack/router");
@@ -68,10 +68,10 @@ var isJWTPayloadWithToken = (payload) => {
68
68
 
69
69
  // src/secure.ts
70
70
  var generateSecure = (length = 32) => {
71
- return import_node_crypto.default.randomBytes(length).toString("base64url");
71
+ return import_crypto.default.randomBytes(length).toString("base64url");
72
72
  };
73
73
  var createHash = (data, base = "hex") => {
74
- return import_node_crypto.default.createHash("sha256").update(data).digest().toString(base);
74
+ return import_crypto.default.createHash("sha256").update(data).digest().toString(base);
75
75
  };
76
76
  var createPKCE = async (verifier) => {
77
77
  const codeVerifier = verifier ?? generateSecure(86);
@@ -106,7 +106,7 @@ var verifyCSRF = async (jose, cookie, header) => {
106
106
  if (!equals(headerBuffer.length, cookieBuffer.length)) {
107
107
  throw new AuthSecurityError("CSRF_TOKEN_INVALID", "The CSRF tokens do not match.");
108
108
  }
109
- if (!import_node_crypto.default.timingSafeEqual(cookieBuffer, headerBuffer)) {
109
+ if (!import_crypto.default.timingSafeEqual(cookieBuffer, headerBuffer)) {
110
110
  throw new AuthSecurityError("CSRF_TOKEN_INVALID", "The CSRF tokens do not match.");
111
111
  }
112
112
  return true;
@@ -115,7 +115,7 @@ var verifyCSRF = async (jose, cookie, header) => {
115
115
  }
116
116
  };
117
117
  var createDerivedSalt = (secret) => {
118
- return import_node_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
118
+ return import_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
119
119
  };
120
120
  // Annotate the CommonJS export names for ESM import in node:
121
121
  0 && (module.exports = {
package/dist/secure.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { A as AuthRuntimeConfig } from './index-EqsoyjrF.js';
2
- import 'zod/v4';
1
+ import { A as AuthRuntimeConfig } from './index-DkaLJFn8.js';
2
+ import 'zod';
3
3
  import './schemas.js';
4
4
  import '@aura-stack/router/cookie';
5
+ import '@aura-stack/jose';
5
6
  import '@aura-stack/jose/jose';
6
7
  import './@types/utility.js';
7
8
 
package/dist/utils.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { ZodError } from 'zod';
2
1
  import { RouterConfig } from '@aura-stack/router';
3
- import { i as APIErrorMap } from './index-EqsoyjrF.js';
4
- import 'zod/v4';
2
+ import { i as APIErrorMap } from './index-DkaLJFn8.js';
3
+ import { ZodError } from 'zod';
5
4
  import './schemas.js';
6
5
  import '@aura-stack/router/cookie';
6
+ import '@aura-stack/jose';
7
7
  import '@aura-stack/jose/jose';
8
8
  import './@types/utility.js';
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-stack/auth",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Core auth for @aura-stack/auth",
@@ -46,12 +46,14 @@
46
46
  "dependencies": {
47
47
  "@aura-stack/router": "^0.5.0",
48
48
  "dotenv": "^17.2.3",
49
- "zod": "^4.1.12",
49
+ "zod": "^4.3.5",
50
50
  "@aura-stack/jose": "0.2.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@aura-stack/tsup-config": "0.0.0",
54
- "@aura-stack/tsconfig": "0.0.0"
53
+ "@types/node": "^24.9.2",
54
+ "typescript": "^5.9.2",
55
+ "@aura-stack/tsconfig": "0.0.0",
56
+ "@aura-stack/tsup-config": "0.0.0"
55
57
  },
56
58
  "scripts": {
57
59
  "dev": "tsup --watch",