@aura-stack/auth 0.1.0-rc.7 → 0.1.0-rc.9

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 (117) hide show
  1. package/dist/@types/index.cjs +15 -15
  2. package/dist/@types/index.d.ts +31 -7
  3. package/dist/@types/index.js +1 -1
  4. package/dist/@types/router.d.cjs +1 -1
  5. package/dist/@types/router.d.d.ts +7 -7
  6. package/dist/@types/utility.cjs +15 -15
  7. package/dist/@types/utility.d.ts +6 -6
  8. package/dist/@types/utility.js +1 -1
  9. package/dist/actions/callback/access-token.cjs +143 -143
  10. package/dist/actions/callback/access-token.d.ts +20 -15
  11. package/dist/actions/callback/access-token.js +4 -8
  12. package/dist/actions/callback/callback.cjs +455 -437
  13. package/dist/actions/callback/callback.d.ts +12 -10
  14. package/dist/actions/callback/callback.js +12 -16
  15. package/dist/actions/callback/userinfo.cjs +134 -131
  16. package/dist/actions/callback/userinfo.d.ts +9 -9
  17. package/dist/actions/callback/userinfo.js +6 -10
  18. package/dist/actions/csrfToken/csrfToken.cjs +171 -162
  19. package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
  20. package/dist/actions/csrfToken/csrfToken.js +8 -12
  21. package/dist/actions/index.cjs +773 -746
  22. package/dist/actions/index.d.ts +13 -13
  23. package/dist/actions/index.js +18 -34
  24. package/dist/actions/session/session.cjs +155 -149
  25. package/dist/actions/session/session.d.ts +3 -3
  26. package/dist/actions/session/session.js +7 -11
  27. package/dist/actions/signIn/authorization.cjs +249 -231
  28. package/dist/actions/signIn/authorization.d.ts +18 -12
  29. package/dist/actions/signIn/authorization.js +6 -16
  30. package/dist/actions/signIn/signIn.cjs +423 -396
  31. package/dist/actions/signIn/signIn.d.ts +10 -10
  32. package/dist/actions/signIn/signIn.js +10 -14
  33. package/dist/actions/signOut/signOut.cjs +440 -417
  34. package/dist/actions/signOut/signOut.d.ts +3 -3
  35. package/dist/actions/signOut/signOut.js +11 -15
  36. package/dist/assert.cjs +36 -35
  37. package/dist/assert.d.ts +4 -4
  38. package/dist/assert.js +2 -10
  39. package/dist/chunk-256KIVJL.js +96 -85
  40. package/dist/chunk-42XB3YCW.js +17 -19
  41. package/dist/chunk-6SM22VVJ.js +10 -13
  42. package/dist/chunk-CAKJT3KS.js +69 -84
  43. package/dist/chunk-E3OXBRYF.js +17 -19
  44. package/dist/chunk-EBPE35JT.js +26 -28
  45. package/dist/chunk-FIPU4MLT.js +16 -18
  46. package/dist/chunk-FJUDBLCP.js +43 -50
  47. package/dist/chunk-FKRDCWBF.js +17 -19
  48. package/dist/chunk-GZU3RBTB.js +40 -51
  49. package/dist/chunk-HGJ4TXY4.js +100 -132
  50. package/dist/chunk-HMRKN75I.js +63 -63
  51. package/dist/chunk-IKHPGFCW.js +9 -11
  52. package/dist/chunk-JAPMIE6S.js +5 -7
  53. package/dist/chunk-KRNOMBXQ.js +17 -19
  54. package/dist/chunk-LLR722CL.js +70 -91
  55. package/dist/chunk-RLT4RFKV.js +30 -39
  56. package/dist/chunk-SJPDVKUS.js +88 -107
  57. package/dist/chunk-SMQO5WD7.js +16 -26
  58. package/dist/chunk-STHEPPUZ.js +6 -8
  59. package/dist/chunk-UJJ7R56J.js +37 -47
  60. package/dist/chunk-UTDLUEEG.js +25 -0
  61. package/dist/chunk-VFTYH33W.js +37 -54
  62. package/dist/chunk-XXJKNKGQ.js +23 -33
  63. package/dist/chunk-ZV4BH47P.js +134 -132
  64. package/dist/cookie.cjs +175 -169
  65. package/dist/cookie.d.ts +51 -23
  66. package/dist/cookie.js +34 -34
  67. package/dist/error.cjs +75 -75
  68. package/dist/error.d.ts +30 -30
  69. package/dist/error.js +8 -15
  70. package/dist/headers.cjs +28 -28
  71. package/dist/headers.d.ts +2 -2
  72. package/dist/headers.js +2 -6
  73. package/dist/index-DpfbvTZ_.d.ts +298 -249
  74. package/dist/index.cjs +969 -933
  75. package/dist/index.d.ts +31 -10
  76. package/dist/index.js +50 -70
  77. package/dist/jose.cjs +67 -52
  78. package/dist/jose.d.ts +8 -8
  79. package/dist/jose.js +5 -9
  80. package/dist/oauth/bitbucket.cjs +38 -38
  81. package/dist/oauth/bitbucket.d.ts +7 -7
  82. package/dist/oauth/bitbucket.js +2 -6
  83. package/dist/oauth/discord.cjs +48 -48
  84. package/dist/oauth/discord.d.ts +7 -7
  85. package/dist/oauth/discord.js +2 -6
  86. package/dist/oauth/figma.cjs +39 -39
  87. package/dist/oauth/figma.d.ts +7 -7
  88. package/dist/oauth/figma.js +2 -6
  89. package/dist/oauth/github.cjs +31 -31
  90. package/dist/oauth/github.d.ts +7 -7
  91. package/dist/oauth/github.js +2 -6
  92. package/dist/oauth/gitlab.cjs +39 -39
  93. package/dist/oauth/gitlab.d.ts +7 -7
  94. package/dist/oauth/gitlab.js +2 -6
  95. package/dist/oauth/index.cjs +180 -180
  96. package/dist/oauth/index.d.ts +26 -7
  97. package/dist/oauth/index.js +9 -36
  98. package/dist/oauth/spotify.cjs +39 -39
  99. package/dist/oauth/spotify.d.ts +7 -7
  100. package/dist/oauth/spotify.js +2 -6
  101. package/dist/oauth/x.cjs +39 -39
  102. package/dist/oauth/x.d.ts +7 -7
  103. package/dist/oauth/x.js +2 -6
  104. package/dist/response.cjs +27 -27
  105. package/dist/response.d.ts +2 -2
  106. package/dist/response.js +2 -6
  107. package/dist/schemas.cjs +91 -91
  108. package/dist/schemas.d.ts +126 -93
  109. package/dist/schemas.js +18 -18
  110. package/dist/secure.cjs +98 -95
  111. package/dist/secure.d.ts +17 -17
  112. package/dist/secure.js +4 -18
  113. package/dist/utils.cjs +132 -119
  114. package/dist/utils.d.ts +26 -11
  115. package/dist/utils.js +21 -21
  116. package/package.json +1 -1
  117. package/dist/chunk-X7M4CQTN.js +0 -25
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ "use strict"
2
+ var __defProp = Object.defineProperty
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
+ var __getOwnPropNames = Object.getOwnPropertyNames
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty
6
6
  var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
7
+ if ((from && typeof from === "object") || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
11
+ }
12
+ return to
13
+ }
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
15
15
 
16
16
  // src/@types/index.ts
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
17
+ var types_exports = {}
18
+ module.exports = __toCommonJS(types_exports)
@@ -1,7 +1,31 @@
1
- import 'zod/v4';
2
- import '@aura-stack/jose/jose';
3
- import '../schemas.js';
4
- import 'cookie';
5
- export { LiteralUnion, Prettify } from './utility.js';
6
- export { y as AccessTokenError, c as AuthConfig, d as AuthInstance, A as AuthRuntimeConfig, w as AuthorizationError, C as CookieConfig, a as CookieConfigInternal, b as CookieName, u as CookieStrategyOptions, E as ErrorType, H as HostCookie, q as JWTStandardClaims, J as JoseInstance, v as OAuthError, O as OAuthProvider, e as OAuthProviderConfig, f as OAuthProviderCredentials, R as RouterGlobalContext, r as SecureCookie, S as Session, t as StandardCookie, T as TokenRevocationError, U as User } from '../index-DpfbvTZ_.js';
7
- import 'zod/v4/core';
1
+ import "zod/v4"
2
+ import "@aura-stack/jose/jose"
3
+ import "../schemas.js"
4
+ import "cookie"
5
+ export { LiteralUnion, Prettify } from "./utility.js"
6
+ export {
7
+ y as AccessTokenError,
8
+ c as AuthConfig,
9
+ d as AuthInstance,
10
+ A as AuthRuntimeConfig,
11
+ w as AuthorizationError,
12
+ C as CookieConfig,
13
+ a as CookieConfigInternal,
14
+ b as CookieName,
15
+ u as CookieStrategyOptions,
16
+ E as ErrorType,
17
+ H as HostCookie,
18
+ q as JWTStandardClaims,
19
+ J as JoseInstance,
20
+ v as OAuthError,
21
+ O as OAuthProvider,
22
+ e as OAuthProviderConfig,
23
+ f as OAuthProviderCredentials,
24
+ R as RouterGlobalContext,
25
+ r as SecureCookie,
26
+ S as Session,
27
+ t as StandardCookie,
28
+ T as TokenRevocationError,
29
+ U as User,
30
+ } from "../index-DpfbvTZ_.js"
31
+ import "zod/v4/core"
@@ -1 +1 @@
1
- import "../chunk-PG7UYFG5.js";
1
+ import "../chunk-PG7UYFG5.js"
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict"
@@ -1,10 +1,10 @@
1
- import { R as RouterGlobalContext } from '../index-DpfbvTZ_.js';
2
- import 'zod/v4';
3
- import '@aura-stack/jose/jose';
4
- import '../schemas.js';
5
- import 'zod/v4/core';
6
- import 'cookie';
7
- import './utility.js';
1
+ import { R as RouterGlobalContext } from "../index-DpfbvTZ_.js"
2
+ import "zod/v4"
3
+ import "@aura-stack/jose/jose"
4
+ import "../schemas.js"
5
+ import "zod/v4/core"
6
+ import "cookie"
7
+ import "./utility.js"
8
8
 
9
9
  declare module "@aura-stack/router" {
10
10
  interface GlobalContext extends RouterGlobalContext {}
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ "use strict"
2
+ var __defProp = Object.defineProperty
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
+ var __getOwnPropNames = Object.getOwnPropertyNames
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty
6
6
  var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
7
+ if ((from && typeof from === "object") || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
11
+ }
12
+ return to
13
+ }
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
15
15
 
16
16
  // src/@types/utility.ts
17
- var utility_exports = {};
18
- module.exports = __toCommonJS(utility_exports);
17
+ var utility_exports = {}
18
+ module.exports = __toCommonJS(utility_exports)
@@ -1,10 +1,10 @@
1
1
  type Prettify<T> = {
2
- [K in keyof T]: T[K];
2
+ [K in keyof T]: T[K]
3
3
  } & {
4
- __aura_auth_prettify_brand?: never;
5
- };
4
+ __aura_auth_prettify_brand?: never
5
+ }
6
6
  type LiteralUnion<T extends U, U = string> = (T | (U & Record<never, never>)) & {
7
- __aura_auth_literal_union_brand?: never;
8
- };
7
+ __aura_auth_literal_union_brand?: never
8
+ }
9
9
 
10
- export type { LiteralUnion, Prettify };
10
+ export type { LiteralUnion, Prettify }
@@ -1 +1 @@
1
- import "../chunk-PG7UYFG5.js";
1
+ import "../chunk-PG7UYFG5.js"
@@ -1,170 +1,170 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ "use strict"
2
+ var __defProp = Object.defineProperty
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
+ var __getOwnPropNames = Object.getOwnPropertyNames
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty
6
6
  var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
7
+ for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
8
+ }
10
9
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
10
+ if ((from && typeof from === "object") || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
14
+ }
15
+ return to
16
+ }
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
19
18
 
20
19
  // src/actions/callback/access-token.ts
21
- var access_token_exports = {};
20
+ var access_token_exports = {}
22
21
  __export(access_token_exports, {
23
- createAccessToken: () => createAccessToken
24
- });
25
- module.exports = __toCommonJS(access_token_exports);
22
+ createAccessToken: () => createAccessToken,
23
+ })
24
+ module.exports = __toCommonJS(access_token_exports)
26
25
 
27
26
  // src/error.ts
28
27
  var AuthError = class extends Error {
29
- constructor(type, message) {
30
- super(message);
31
- this.type = type;
32
- this.name = "AuthError";
33
- }
34
- };
28
+ constructor(type, message) {
29
+ super(message)
30
+ this.type = type
31
+ this.name = "AuthError"
32
+ }
33
+ }
35
34
  var isAuthError = (error) => {
36
- return error instanceof AuthError;
37
- };
35
+ return error instanceof AuthError
36
+ }
38
37
  var throwAuthError = (error, message) => {
39
- if (error instanceof Error) {
40
- if (isAuthError(error)) {
41
- throw error;
38
+ if (error instanceof Error) {
39
+ if (isAuthError(error)) {
40
+ throw error
41
+ }
42
+ throw new AuthError("invalid_request", error.message ?? message)
42
43
  }
43
- throw new AuthError("invalid_request", error.message ?? message);
44
- }
45
- };
44
+ }
46
45
  var ERROR_RESPONSE = {
47
- AUTHORIZATION: {
48
- INVALID_REQUEST: "invalid_request",
49
- UNAUTHORIZED_CLIENT: "unauthorized_client",
50
- ACCESS_DENIED: "access_denied",
51
- UNSUPPORTED_RESPONSE_TYPE: "unsupported_response_type",
52
- INVALID_SCOPE: "invalid_scope",
53
- SERVER_ERROR: "server_error",
54
- TEMPORARILY_UNAVAILABLE: "temporarily_unavailable"
55
- },
56
- ACCESS_TOKEN: {
57
- INVALID_REQUEST: "invalid_request",
58
- INVALID_CLIENT: "invalid_client",
59
- INVALID_GRANT: "invalid_grant",
60
- UNAUTHORIZED_CLIENT: "unauthorized_client",
61
- UNSUPPORTED_GRANT_TYPE: "unsupported_grant_type",
62
- INVALID_SCOPE: "invalid_scope"
63
- }
64
- };
46
+ AUTHORIZATION: {
47
+ INVALID_REQUEST: "invalid_request",
48
+ UNAUTHORIZED_CLIENT: "unauthorized_client",
49
+ ACCESS_DENIED: "access_denied",
50
+ UNSUPPORTED_RESPONSE_TYPE: "unsupported_response_type",
51
+ INVALID_SCOPE: "invalid_scope",
52
+ SERVER_ERROR: "server_error",
53
+ TEMPORARILY_UNAVAILABLE: "temporarily_unavailable",
54
+ },
55
+ ACCESS_TOKEN: {
56
+ INVALID_REQUEST: "invalid_request",
57
+ INVALID_CLIENT: "invalid_client",
58
+ INVALID_GRANT: "invalid_grant",
59
+ UNAUTHORIZED_CLIENT: "unauthorized_client",
60
+ UNSUPPORTED_GRANT_TYPE: "unsupported_grant_type",
61
+ INVALID_SCOPE: "invalid_scope",
62
+ },
63
+ }
65
64
 
66
65
  // src/schemas.ts
67
- var import_v4 = require("zod/v4");
66
+ var import_v4 = require("zod/v4")
68
67
  var OAuthProviderConfigSchema = (0, import_v4.object)({
69
- authorizeURL: (0, import_v4.url)(),
70
- accessToken: (0, import_v4.url)(),
71
- scope: (0, import_v4.string)().optional(),
72
- userInfo: (0, import_v4.url)(),
73
- responseType: (0, import_v4.enum)(["code", "token", "id_token"]),
74
- clientId: (0, import_v4.string)(),
75
- clientSecret: (0, import_v4.string)()
76
- });
68
+ authorizeURL: (0, import_v4.url)(),
69
+ accessToken: (0, import_v4.url)(),
70
+ scope: (0, import_v4.string)().optional(),
71
+ userInfo: (0, import_v4.url)(),
72
+ responseType: (0, import_v4.enum)(["code", "token", "id_token"]),
73
+ clientId: (0, import_v4.string)(),
74
+ clientSecret: (0, import_v4.string)(),
75
+ })
77
76
  var OAuthAuthorization = OAuthProviderConfigSchema.extend({
78
- redirectURI: (0, import_v4.string)(),
79
- state: (0, import_v4.string)(),
80
- codeChallenge: (0, import_v4.string)(),
81
- codeChallengeMethod: (0, import_v4.enum)(["plain", "S256"])
82
- });
77
+ redirectURI: (0, import_v4.string)(),
78
+ state: (0, import_v4.string)(),
79
+ codeChallenge: (0, import_v4.string)(),
80
+ codeChallengeMethod: (0, import_v4.enum)(["plain", "S256"]),
81
+ })
83
82
  var OAuthAuthorizationResponse = (0, import_v4.object)({
84
- state: (0, import_v4.string)(),
85
- code: (0, import_v4.string)()
86
- });
83
+ state: (0, import_v4.string)(),
84
+ code: (0, import_v4.string)(),
85
+ })
87
86
  var OAuthAuthorizationErrorResponse = (0, import_v4.object)({
88
- error: (0, import_v4.enum)([
89
- "invalid_request",
90
- "unauthorized_client",
91
- "access_denied",
92
- "unsupported_response_type",
93
- "invalid_scope",
94
- "server_error",
95
- "temporarily_unavailable"
96
- ]),
97
- error_description: (0, import_v4.string)().optional(),
98
- error_uri: (0, import_v4.string)().optional(),
99
- state: (0, import_v4.string)()
100
- });
87
+ error: (0, import_v4.enum)([
88
+ "invalid_request",
89
+ "unauthorized_client",
90
+ "access_denied",
91
+ "unsupported_response_type",
92
+ "invalid_scope",
93
+ "server_error",
94
+ "temporarily_unavailable",
95
+ ]),
96
+ error_description: (0, import_v4.string)().optional(),
97
+ error_uri: (0, import_v4.string)().optional(),
98
+ state: (0, import_v4.string)(),
99
+ })
101
100
  var OAuthAccessToken = OAuthProviderConfigSchema.extend({
102
- redirectURI: (0, import_v4.string)(),
103
- code: (0, import_v4.string)(),
104
- codeVerifier: (0, import_v4.string)().min(43).max(128)
105
- });
101
+ redirectURI: (0, import_v4.string)(),
102
+ code: (0, import_v4.string)(),
103
+ codeVerifier: (0, import_v4.string)().min(43).max(128),
104
+ })
106
105
  var OAuthAccessTokenResponse = (0, import_v4.object)({
107
- access_token: (0, import_v4.string)(),
108
- token_type: (0, import_v4.string)(),
109
- expires_in: (0, import_v4.number)().optional(),
110
- refresh_token: (0, import_v4.string)().optional(),
111
- scope: (0, import_v4.string)().optional()
112
- });
106
+ access_token: (0, import_v4.string)(),
107
+ token_type: (0, import_v4.string)(),
108
+ expires_in: (0, import_v4.number)().optional(),
109
+ refresh_token: (0, import_v4.string)().optional(),
110
+ scope: (0, import_v4.string)().optional(),
111
+ })
113
112
  var OAuthAccessTokenErrorResponse = (0, import_v4.object)({
114
- error: (0, import_v4.enum)([
115
- "invalid_request",
116
- "invalid_client",
117
- "invalid_grant",
118
- "unauthorized_client",
119
- "unsupported_grant_type",
120
- "invalid_scope"
121
- ]),
122
- error_description: (0, import_v4.string)().optional(),
123
- error_uri: (0, import_v4.string)().optional()
124
- });
113
+ error: (0, import_v4.enum)([
114
+ "invalid_request",
115
+ "invalid_client",
116
+ "invalid_grant",
117
+ "unauthorized_client",
118
+ "unsupported_grant_type",
119
+ "invalid_scope",
120
+ ]),
121
+ error_description: (0, import_v4.string)().optional(),
122
+ error_uri: (0, import_v4.string)().optional(),
123
+ })
125
124
  var OAuthErrorResponse = (0, import_v4.object)({
126
- error: (0, import_v4.string)(),
127
- error_description: (0, import_v4.string)().optional()
128
- });
125
+ error: (0, import_v4.string)(),
126
+ error_description: (0, import_v4.string)().optional(),
127
+ })
129
128
 
130
129
  // src/actions/callback/access-token.ts
131
130
  var createAccessToken = async (oauthConfig, redirectURI, code, codeVerifier) => {
132
- const parsed = OAuthAccessToken.safeParse({ ...oauthConfig, redirectURI, code, codeVerifier });
133
- if (!parsed.success) {
134
- throw new AuthError(ERROR_RESPONSE.ACCESS_TOKEN.INVALID_REQUEST, "Invalid OAuth configuration");
135
- }
136
- const { accessToken, clientId, clientSecret, code: codeParsed, redirectURI: redirectParsed } = parsed.data;
137
- try {
138
- const response = await fetch(accessToken, {
139
- method: "POST",
140
- headers: {
141
- Accept: "application/json",
142
- "Content-Type": "application/x-www-form-urlencoded"
143
- },
144
- body: new URLSearchParams({
145
- client_id: clientId,
146
- client_secret: clientSecret,
147
- code: codeParsed,
148
- redirect_uri: redirectParsed,
149
- grant_type: "authorization_code",
150
- code_verifier: codeVerifier
151
- }).toString()
152
- });
153
- const json = await response.json();
154
- const token = OAuthAccessTokenResponse.safeParse(json);
155
- if (!token.success) {
156
- const { success, data } = OAuthAccessTokenErrorResponse.safeParse(json);
157
- if (!success) {
158
- throw new AuthError(ERROR_RESPONSE.ACCESS_TOKEN.INVALID_GRANT, "Invalid access token response format");
159
- }
160
- throw new AuthError(data.error, data?.error_description ?? "Failed to retrieve access token");
131
+ const parsed = OAuthAccessToken.safeParse({ ...oauthConfig, redirectURI, code, codeVerifier })
132
+ if (!parsed.success) {
133
+ throw new AuthError(ERROR_RESPONSE.ACCESS_TOKEN.INVALID_REQUEST, "Invalid OAuth configuration")
134
+ }
135
+ const { accessToken, clientId, clientSecret, code: codeParsed, redirectURI: redirectParsed } = parsed.data
136
+ try {
137
+ const response = await fetch(accessToken, {
138
+ method: "POST",
139
+ headers: {
140
+ Accept: "application/json",
141
+ "Content-Type": "application/x-www-form-urlencoded",
142
+ },
143
+ body: new URLSearchParams({
144
+ client_id: clientId,
145
+ client_secret: clientSecret,
146
+ code: codeParsed,
147
+ redirect_uri: redirectParsed,
148
+ grant_type: "authorization_code",
149
+ code_verifier: codeVerifier,
150
+ }).toString(),
151
+ })
152
+ const json = await response.json()
153
+ const token = OAuthAccessTokenResponse.safeParse(json)
154
+ if (!token.success) {
155
+ const { success, data } = OAuthAccessTokenErrorResponse.safeParse(json)
156
+ if (!success) {
157
+ throw new AuthError(ERROR_RESPONSE.ACCESS_TOKEN.INVALID_GRANT, "Invalid access token response format")
158
+ }
159
+ throw new AuthError(data.error, data?.error_description ?? "Failed to retrieve access token")
160
+ }
161
+ return token.data
162
+ } catch (error) {
163
+ throw throwAuthError(error, "Failed to create access token")
161
164
  }
162
- return token.data;
163
- } catch (error) {
164
- throw throwAuthError(error, "Failed to create access token");
165
- }
166
- };
165
+ }
167
166
  // Annotate the CommonJS export names for ESM import in node:
168
- 0 && (module.exports = {
169
- createAccessToken
170
- });
167
+ 0 &&
168
+ (module.exports = {
169
+ createAccessToken,
170
+ })
@@ -1,10 +1,10 @@
1
- import { f as OAuthProviderCredentials } from '../../index-DpfbvTZ_.js';
2
- import 'zod/v4';
3
- import '@aura-stack/jose/jose';
4
- import '../../schemas.js';
5
- import 'zod/v4/core';
6
- import 'cookie';
7
- import '../../@types/utility.js';
1
+ import { f as OAuthProviderCredentials } from "../../index-DpfbvTZ_.js"
2
+ import "zod/v4"
3
+ import "@aura-stack/jose/jose"
4
+ import "../../schemas.js"
5
+ import "zod/v4/core"
6
+ import "cookie"
7
+ import "../../@types/utility.js"
8
8
 
9
9
  /**
10
10
  * Make a request to the OAuth provider to the token endpoint to exchange the authorization code provided
@@ -17,12 +17,17 @@ import '../../@types/utility.js';
17
17
  * @param code - The authorization code received from the OAuth server
18
18
  * @returns The access token response from the OAuth server
19
19
  */
20
- declare const createAccessToken: (oauthConfig: OAuthProviderCredentials, redirectURI: string, code: string, codeVerifier: string) => Promise<{
21
- access_token: string;
22
- token_type: string;
23
- expires_in?: number | undefined;
24
- refresh_token?: string | undefined;
25
- scope?: string | undefined;
26
- }>;
20
+ declare const createAccessToken: (
21
+ oauthConfig: OAuthProviderCredentials,
22
+ redirectURI: string,
23
+ code: string,
24
+ codeVerifier: string
25
+ ) => Promise<{
26
+ access_token: string
27
+ token_type: string
28
+ expires_in?: number | undefined
29
+ refresh_token?: string | undefined
30
+ scope?: string | undefined
31
+ }>
27
32
 
28
- export { createAccessToken };
33
+ export { createAccessToken }
@@ -1,8 +1,4 @@
1
- import {
2
- createAccessToken
3
- } from "../../chunk-UJJ7R56J.js";
4
- import "../../chunk-FJUDBLCP.js";
5
- import "../../chunk-HMRKN75I.js";
6
- export {
7
- createAccessToken
8
- };
1
+ import { createAccessToken } from "../../chunk-UJJ7R56J.js"
2
+ import "../../chunk-FJUDBLCP.js"
3
+ import "../../chunk-HMRKN75I.js"
4
+ export { createAccessToken }