@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.
- package/dist/@types/index.d.ts +3 -2
- package/dist/@types/router.d.d.ts +3 -2
- package/dist/actions/callback/access-token.cjs +52 -41
- package/dist/actions/callback/access-token.d.ts +5 -4
- package/dist/actions/callback/access-token.js +3 -2
- package/dist/actions/callback/callback.cjs +69 -52
- package/dist/actions/callback/callback.d.ts +4 -3
- package/dist/actions/callback/callback.js +6 -5
- package/dist/actions/callback/userinfo.cjs +54 -43
- package/dist/actions/callback/userinfo.d.ts +3 -2
- package/dist/actions/callback/userinfo.js +3 -2
- package/dist/actions/csrfToken/csrfToken.cjs +2 -2
- package/dist/actions/csrfToken/csrfToken.js +2 -2
- package/dist/actions/index.cjs +93 -71
- package/dist/actions/index.d.ts +3 -2
- package/dist/actions/index.js +15 -14
- package/dist/actions/session/session.js +2 -2
- package/dist/actions/signIn/authorization.cjs +40 -40
- package/dist/actions/signIn/authorization.d.ts +3 -2
- package/dist/actions/signIn/authorization.js +2 -2
- package/dist/actions/signIn/signIn.cjs +63 -50
- package/dist/actions/signIn/signIn.d.ts +4 -3
- package/dist/actions/signIn/signIn.js +4 -3
- package/dist/actions/signOut/signOut.cjs +66 -66
- package/dist/actions/signOut/signOut.js +4 -4
- package/dist/assert.d.ts +3 -2
- package/dist/{chunk-2RXNXMCZ.js → chunk-3EUWD5BB.js} +15 -7
- package/dist/{chunk-NEVKX6K2.js → chunk-A3N4PVAT.js} +3 -3
- package/dist/chunk-B737EUJV.js +22 -0
- package/dist/{chunk-7H3OR6UU.js → chunk-EMKJA2GJ.js} +18 -10
- package/dist/{chunk-4V4JNXVF.js → chunk-GA2SMTJO.js} +9 -6
- package/dist/chunk-HP34YGGJ.js +22 -0
- package/dist/{chunk-QDO2KSRJ.js → chunk-HT4YLL7N.js} +1 -1
- package/dist/{chunk-ZLR3LI6X.js → chunk-IVET23KF.js} +7 -4
- package/dist/{chunk-PTJUYB33.js → chunk-JVFTCTTE.js} +1 -1
- package/dist/{chunk-UEH3LVON.js → chunk-KSWLO5ZU.js} +21 -16
- package/dist/{chunk-QEZL7EYN.js → chunk-N4SX7TZT.js} +3 -3
- package/dist/{chunk-IMICRJ5U.js → chunk-W6LG7BFW.js} +14 -14
- package/dist/{chunk-WD7AUHQ5.js → chunk-YRCB5FLE.js} +8 -8
- package/dist/chunk-ZNCZVF6U.js +14 -0
- package/dist/cookie.cjs +14 -14
- package/dist/cookie.d.ts +3 -2
- package/dist/cookie.js +1 -1
- package/dist/errors.d.ts +3 -2
- package/dist/{index-EqsoyjrF.d.ts → index-DkaLJFn8.d.ts} +57 -8
- package/dist/index.cjs +155 -93
- package/dist/index.d.ts +4 -3
- package/dist/index.js +20 -17
- package/dist/jose.cjs +2 -2
- package/dist/oauth/bitbucket.d.ts +3 -2
- package/dist/oauth/discord.d.ts +3 -2
- package/dist/oauth/figma.d.ts +3 -2
- package/dist/oauth/github.d.ts +3 -2
- package/dist/oauth/gitlab.d.ts +3 -2
- package/dist/oauth/index.cjs +85 -41
- package/dist/oauth/index.d.ts +3 -2
- package/dist/oauth/index.js +16 -8
- package/dist/oauth/mailchimp.cjs +46 -0
- package/dist/oauth/mailchimp.d.ts +7 -0
- package/dist/oauth/mailchimp.js +6 -0
- package/dist/oauth/pinterest.cjs +46 -0
- package/dist/oauth/pinterest.d.ts +7 -0
- package/dist/oauth/pinterest.js +6 -0
- package/dist/oauth/spotify.d.ts +3 -2
- package/dist/oauth/strava.d.ts +3 -2
- package/dist/oauth/x.d.ts +3 -2
- package/dist/request.cjs +38 -0
- package/dist/request.d.ts +13 -0
- package/dist/request.js +6 -0
- package/dist/schemas.cjs +40 -40
- package/dist/schemas.d.ts +15 -15
- package/dist/schemas.js +1 -1
- package/dist/secure.cjs +5 -5
- package/dist/secure.d.ts +3 -2
- package/dist/utils.d.ts +3 -3
- 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
|
|
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
|
|
71
|
+
return import_crypto.default.randomBytes(length).toString("base64url");
|
|
72
72
|
};
|
|
73
73
|
var createHash = (data, base = "hex") => {
|
|
74
|
-
return
|
|
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 (!
|
|
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
|
|
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-
|
|
2
|
-
import 'zod
|
|
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-
|
|
4
|
-
import 'zod
|
|
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.
|
|
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.
|
|
49
|
+
"zod": "^4.3.5",
|
|
50
50
|
"@aura-stack/jose": "0.2.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
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",
|