@gatwech/auth 1.0.0-beta.20 → 1.0.0-beta.21
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/adapters/drizzle-adapter/index.mjs +11 -2
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/kysely-adapter/index.mjs +1 -1
- package/dist/adapters/memory-adapter/index.d.mts +1 -1
- package/dist/adapters/memory-adapter/index.mjs +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.mjs +1 -1
- package/dist/{audit-log-DKsUWR8O.mjs → audit-log-DgqHJ-uv.mjs} +132 -63
- package/dist/{auth-vfCyIIeV.mjs → auth-BoEA9bN7.mjs} +14 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/plugins/index.d.mts +47 -47
- package/dist/client/plugins/index.mjs +2 -2
- package/dist/client/react/index.d.mts +2 -2
- package/dist/{client-F67q-Lbi.d.mts → client-B00gkznv.d.mts} +1 -1
- package/dist/{client-4QEb0rUr.mjs → client-CMsC6-rl.mjs} +1 -1
- package/dist/{client-C_qmyez2.d.mts → client-Da7tq8m6.d.mts} +1 -1
- package/dist/cookies/index.d.mts +3 -3
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{db-7vHnL1XA.mjs → db-CV59HpEF.mjs} +2 -2
- package/dist/{index-BX7rl07Z.d.mts → index-BECNG13R.d.mts} +13 -13
- package/dist/{index-D57DuhZR.d.mts → index-BKy-8t2n.d.mts} +179 -126
- package/dist/{index-Df0KhQRf-BEa5tdwJ.d.mts → index-BL_t8cRp-C4QYBsac.d.mts} +56 -17
- package/dist/{index-D6ku0rUC.d.mts → index-BWYXZVsV.d.mts} +5 -5
- package/dist/{index-DwPAddfE.d.mts → index-Bhc37y9F.d.mts} +3 -3
- package/dist/{index-BNhJglHC.d.mts → index-BjCQ3jmE.d.mts} +119 -119
- package/dist/{index-CzpdkTdv.d.mts → index-Bxive_YT.d.mts} +9 -9
- package/dist/{index-DGeoJ4gu.d.mts → index-C-IDh5yy.d.mts} +2 -2
- package/dist/{index-Dnd8S4S4.d.mts → index-CM1rFdwV.d.mts} +9 -9
- package/dist/{index-CNd5jqLl.d.mts → index-CMG4Pnen.d.mts} +4 -4
- package/dist/{index-4I1YhYhk.d.mts → index-CTqynuxm.d.mts} +4 -4
- package/dist/{index-CP8x1TFq.d.mts → index-CbBQdS-u.d.mts} +6 -6
- package/dist/{index-DyXi7S2M.d.mts → index-CpH-1sse.d.mts} +10 -10
- package/dist/{index-CC920PPp.d.mts → index-D1OZ2e4m.d.mts} +14 -14
- package/dist/{index-CofuaNMl.d.mts → index-Dt2I0G4X.d.mts} +7 -7
- package/dist/{index-XfE0WjTN.d.mts → index-IX1to9TB.d.mts} +34 -34
- package/dist/{index-KhbNmMmG.d.mts → index-TrOnY3pM.d.mts} +170 -170
- package/dist/{index-CsxtcAO0.d.mts → index-VUyESU4p.d.mts} +1 -1
- package/dist/{index-CBiGsvDd.d.mts → index-WV7VzW2H.d.mts} +8 -8
- package/dist/{index-Bml-PCqP.d.mts → index-YeXSxzhX.d.mts} +19 -19
- package/dist/{index-BsSKcKgO.d.mts → index-cPt-00xm.d.mts} +6 -6
- package/dist/{index-sb-UFLuo.d.mts → index-iRoaTsOj.d.mts} +2 -2
- package/dist/{index-DFSRYWFI.d.mts → index-jEkJ2Zfk.d.mts} +6 -6
- package/dist/{index-DTkcY7xH.d.mts → index-oNlp4SvD.d.mts} +10 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/node.d.mts +2 -2
- package/dist/integrations/react-start.d.mts +4 -4
- package/dist/{kysely-adapter-Bkm1liPW.mjs → kysely-adapter-BidlNTiV.mjs} +4 -2
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.mjs +1 -1
- package/dist/{organization-CkTKs7bx.mjs → organization-D4QMpChF.mjs} +1 -1
- package/dist/plugins/admin/index.d.mts +3 -3
- package/dist/plugins/admin/index.mjs +1 -1
- package/dist/plugins/anonymous/index.d.mts +3 -3
- package/dist/plugins/anonymous/index.mjs +1 -1
- package/dist/plugins/audit-log/client.d.mts +24 -24
- package/dist/plugins/audit-log/index.d.mts +23 -23
- package/dist/plugins/audit-log/index.mjs +2 -2
- package/dist/plugins/bearer/index.d.mts +1 -1
- package/dist/plugins/captcha/index.d.mts +1 -1
- package/dist/plugins/custom-session/index.d.mts +3 -3
- package/dist/plugins/custom-session/index.mjs +1 -1
- package/dist/plugins/device-authorization/index.d.mts +1 -1
- package/dist/plugins/device-authorization/index.mjs +1 -1
- package/dist/plugins/email-otp/index.d.mts +2 -2
- package/dist/plugins/email-otp/index.mjs +1 -1
- package/dist/plugins/generic-oauth/index.d.mts +3 -3
- package/dist/plugins/generic-oauth/index.mjs +1 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
- package/dist/plugins/haveibeenpwned/index.mjs +1 -1
- package/dist/plugins/index.d.mts +23 -23
- package/dist/plugins/index.mjs +5 -5
- package/dist/plugins/jwt/index.d.mts +3 -3
- package/dist/plugins/jwt/index.mjs +1 -1
- package/dist/plugins/magic-link/index.d.mts +1 -1
- package/dist/plugins/magic-link/index.mjs +1 -1
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.mjs +1 -1
- package/dist/plugins/oauth-proxy/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +1 -1
- package/dist/plugins/one-tap/index.d.mts +1 -1
- package/dist/plugins/one-tap/index.mjs +1 -1
- package/dist/plugins/one-time-token/index.d.mts +3 -3
- package/dist/plugins/one-time-token/index.mjs +5 -5
- package/dist/plugins/organization/index.d.mts +3 -3
- package/dist/plugins/organization/index.mjs +2 -2
- package/dist/plugins/passkey/index.d.mts +3 -3
- package/dist/plugins/passkey/index.mjs +1 -1
- package/dist/plugins/phone-number/index.d.mts +3 -3
- package/dist/plugins/phone-number/index.mjs +1 -1
- package/dist/plugins/sentinel/client.d.mts +24 -24
- package/dist/plugins/sentinel/client.mjs +2 -2
- package/dist/plugins/sentinel/index.d.mts +23 -23
- package/dist/plugins/sentinel/index.mjs +3 -3
- package/dist/plugins/two-factor/index.d.mts +3 -3
- package/dist/plugins/two-factor/index.mjs +1 -1
- package/dist/plugins/username/index.d.mts +1 -1
- package/dist/plugins/username/index.mjs +1 -1
- package/dist/{pow-OK01yPG3.mjs → pow-DvkUopsK.mjs} +17 -1
- package/dist/{sentinel-DiPqydKG.mjs → sentinel-B4Wo79HK.mjs} +295 -92
- package/dist/src/adapters/memory-adapter/memory-adapter.d.ts +1 -1
- package/dist/src/adapters/prisma-adapter/test/auth.d.ts +1 -1
- package/dist/src/adapters/tests/auth-flow.d.ts +3 -3
- package/dist/src/adapters/tests/normal.d.ts +10 -2
- package/dist/src/adapters/tests/number-id.d.ts +4 -4
- package/dist/src/adapters/tests/performance.d.ts +3 -3
- package/dist/src/adapters/tests/transactions.d.ts +3 -3
- package/dist/src/api/index.d.ts +8 -8
- package/dist/src/plugins/admin/admin.d.ts +2 -2
- package/dist/src/plugins/api-key/index.d.ts +2 -2
- package/dist/src/plugins/audit-log/index.d.ts +5 -14
- package/dist/src/plugins/audit-log/remote.d.ts +4 -4
- package/dist/src/plugins/audit-log/types.d.ts +22 -0
- package/dist/src/plugins/email-otp/index.d.ts +1 -1
- package/dist/src/plugins/multi-session/index.d.ts +8 -8
- package/dist/src/plugins/organization/routes/crud-access-control.d.ts +8 -8
- package/dist/src/plugins/organization/routes/crud-invites.d.ts +46 -46
- package/dist/src/plugins/organization/routes/crud-members.d.ts +40 -40
- package/dist/src/plugins/organization/routes/crud-org.d.ts +36 -36
- package/dist/src/plugins/organization/routes/crud-team.d.ts +50 -50
- package/dist/src/plugins/sentinel/index.d.ts +10 -1
- package/dist/src/plugins/sentinel/intel.d.ts +8 -1
- package/dist/src/plugins/sentinel/memory-cache.d.ts +12 -0
- package/dist/src/plugins/sentinel/schema.d.ts +4 -0
- package/dist/src/plugins/sentinel/store.d.ts +7 -0
- package/dist/src/plugins/sentinel/types.d.ts +29 -1
- package/dist/src/test-utils/test-instance.d.ts +25 -25
- package/dist/test-utils/index.d.mts +1045 -1045
- package/dist/test-utils/index.mjs +7 -7
- package/dist/types/index.d.mts +2 -2
- package/package.json +3 -3
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import "../../helper-BgOIGHsu.mjs";
|
|
2
|
-
import "../../index-
|
|
2
|
+
import "../../index-BjCQ3jmE.mjs";
|
|
3
3
|
import "../../types-DNQ9XQrB.mjs";
|
|
4
|
-
import "../../index-
|
|
4
|
+
import "../../index-BL_t8cRp-C4QYBsac.mjs";
|
|
5
5
|
import "../../plugins-Dy_FrD4Y.mjs";
|
|
6
6
|
import "../../index-CxlWnL9c.mjs";
|
|
7
|
-
import "../../index-
|
|
8
|
-
import "../../index-
|
|
9
|
-
import { S as SentinelOptions, _ as haversineDistanceKm, b as GeoLocation, c as sentinel, d as POW_SOLUTION_HEADER, f as createNonce, g as verifySolution, h as solveChallenge, l as POW_CHALLENGE_HEADER, m as parsePowHeader, p as hasLeadingZeroBits, u as POW_REASON_HEADER, v as normalizeEmail, x as SecurityAction, y as SENTINEL_ERROR_CODES } from "../../index-
|
|
10
|
-
import "../../index-
|
|
11
|
-
import "../../index-
|
|
12
|
-
import "../../index-
|
|
13
|
-
import "../../index-
|
|
14
|
-
import "../../index-
|
|
15
|
-
import "../../index-
|
|
16
|
-
import "../../index-
|
|
17
|
-
import "../../index-
|
|
18
|
-
import "../../index-
|
|
19
|
-
import "../../index-
|
|
20
|
-
import "../../index-
|
|
21
|
-
import "../../index-
|
|
22
|
-
import "../../index-
|
|
7
|
+
import "../../index-IX1to9TB.mjs";
|
|
8
|
+
import "../../index-CMG4Pnen.mjs";
|
|
9
|
+
import { S as SentinelOptions, _ as haversineDistanceKm, b as GeoLocation, c as sentinel, d as POW_SOLUTION_HEADER, f as createNonce, g as verifySolution, h as solveChallenge, l as POW_CHALLENGE_HEADER, m as parsePowHeader, p as hasLeadingZeroBits, u as POW_REASON_HEADER, v as normalizeEmail, x as SecurityAction, y as SENTINEL_ERROR_CODES } from "../../index-BKy-8t2n.mjs";
|
|
10
|
+
import "../../index-CbBQdS-u.mjs";
|
|
11
|
+
import "../../index-C-IDh5yy.mjs";
|
|
12
|
+
import "../../index-cPt-00xm.mjs";
|
|
13
|
+
import "../../index-jEkJ2Zfk.mjs";
|
|
14
|
+
import "../../index-D1OZ2e4m.mjs";
|
|
15
|
+
import "../../index-WV7VzW2H.mjs";
|
|
16
|
+
import "../../index-Bhc37y9F.mjs";
|
|
17
|
+
import "../../index-CM1rFdwV.mjs";
|
|
18
|
+
import "../../index-CTqynuxm.mjs";
|
|
19
|
+
import "../../index-CpH-1sse.mjs";
|
|
20
|
+
import "../../index-oNlp4SvD.mjs";
|
|
21
|
+
import "../../index-iRoaTsOj.mjs";
|
|
22
|
+
import "../../index-BWYXZVsV.mjs";
|
|
23
23
|
import "../../index-QmocqGM-.mjs";
|
|
24
|
-
import "../../index-
|
|
25
|
-
import "../../index-
|
|
26
|
-
import "../../index-
|
|
27
|
-
import "../../index-
|
|
28
|
-
import "../../index-
|
|
24
|
+
import "../../index-TrOnY3pM.mjs";
|
|
25
|
+
import "../../index-Dt2I0G4X.mjs";
|
|
26
|
+
import "../../index-YeXSxzhX.mjs";
|
|
27
|
+
import "../../index-BECNG13R.mjs";
|
|
28
|
+
import "../../index-Bxive_YT.mjs";
|
|
29
29
|
export { GeoLocation, POW_CHALLENGE_HEADER, POW_REASON_HEADER, POW_SOLUTION_HEADER, SENTINEL_ERROR_CODES, SecurityAction, SentinelOptions, createNonce, hasLeadingZeroBits, haversineDistanceKm, normalizeEmail, parsePowHeader, sentinel, solveChallenge, verifySolution };
|
|
@@ -8,7 +8,7 @@ import "../../jwt-CmxZAGe2.mjs";
|
|
|
8
8
|
import "../../random-32E3cU5o.mjs";
|
|
9
9
|
import "../../cookies-BuvlgcA-.mjs";
|
|
10
10
|
import "../../date-CMr04reD.mjs";
|
|
11
|
-
import "../../db-
|
|
11
|
+
import "../../db-CV59HpEF.mjs";
|
|
12
12
|
import "../../dialect-HsWUfpYY.mjs";
|
|
13
13
|
import "../../get-tables-CKvSyDST.mjs";
|
|
14
14
|
import "../../types-DCPpFKUB.mjs";
|
|
@@ -16,7 +16,7 @@ import "../../misc-fKH4d5XQ.mjs";
|
|
|
16
16
|
import "../../session-BB3oqApE.mjs";
|
|
17
17
|
import "../../registry-CqG_3Qnx.mjs";
|
|
18
18
|
import "../../haveibeenpwned-CzNda7Tn.mjs";
|
|
19
|
-
import { a as hasLeadingZeroBits, c as verifySolution, i as createNonce, n as POW_REASON_HEADER, o as parsePowHeader, r as POW_SOLUTION_HEADER, s as solveChallenge, t as POW_CHALLENGE_HEADER } from "../../pow-
|
|
20
|
-
import { i as SENTINEL_ERROR_CODES, n as haversineDistanceKm, r as normalizeEmail, t as sentinel } from "../../sentinel-
|
|
19
|
+
import { a as hasLeadingZeroBits, c as verifySolution, i as createNonce, n as POW_REASON_HEADER, o as parsePowHeader, r as POW_SOLUTION_HEADER, s as solveChallenge, t as POW_CHALLENGE_HEADER } from "../../pow-DvkUopsK.mjs";
|
|
20
|
+
import { i as SENTINEL_ERROR_CODES, n as haversineDistanceKm, r as normalizeEmail, t as sentinel } from "../../sentinel-B4Wo79HK.mjs";
|
|
21
21
|
|
|
22
22
|
export { POW_CHALLENGE_HEADER, POW_REASON_HEADER, POW_SOLUTION_HEADER, SENTINEL_ERROR_CODES, createNonce, hasLeadingZeroBits, haversineDistanceKm, normalizeEmail, parsePowHeader, sentinel, solveChallenge, verifySolution };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../helper-BgOIGHsu.mjs";
|
|
2
|
-
import "../../index-
|
|
2
|
+
import "../../index-BjCQ3jmE.mjs";
|
|
3
3
|
import "../../types-DNQ9XQrB.mjs";
|
|
4
|
-
import "../../index-
|
|
4
|
+
import "../../index-BL_t8cRp-C4QYBsac.mjs";
|
|
5
5
|
import "../../plugins-Dy_FrD4Y.mjs";
|
|
6
|
-
import { a as TwoFactorProvider, i as TwoFactorOptions, n as twoFactorClient, o as TwoFactorTable, r as TWO_FACTOR_ERROR_CODES, s as UserWithTwoFactor, t as twoFactor } from "../../index-
|
|
6
|
+
import { a as TwoFactorProvider, i as TwoFactorOptions, n as twoFactorClient, o as TwoFactorTable, r as TWO_FACTOR_ERROR_CODES, s as UserWithTwoFactor, t as twoFactor } from "../../index-YeXSxzhX.mjs";
|
|
7
7
|
export { TWO_FACTOR_ERROR_CODES, TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor, twoFactor, twoFactorClient };
|
|
@@ -8,7 +8,7 @@ import "../../jwt-CmxZAGe2.mjs";
|
|
|
8
8
|
import "../../random-32E3cU5o.mjs";
|
|
9
9
|
import "../../cookies-BuvlgcA-.mjs";
|
|
10
10
|
import "../../date-CMr04reD.mjs";
|
|
11
|
-
import "../../db-
|
|
11
|
+
import "../../db-CV59HpEF.mjs";
|
|
12
12
|
import "../../dialect-HsWUfpYY.mjs";
|
|
13
13
|
import "../../get-tables-CKvSyDST.mjs";
|
|
14
14
|
import "../../types-DCPpFKUB.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../helper-BgOIGHsu.mjs";
|
|
2
2
|
import "../../plugins-Dy_FrD4Y.mjs";
|
|
3
|
-
import { n as username, r as USERNAME_ERROR_CODES, t as UsernameOptions } from "../../index-
|
|
3
|
+
import { n as username, r as USERNAME_ERROR_CODES, t as UsernameOptions } from "../../index-Bxive_YT.mjs";
|
|
4
4
|
export { USERNAME_ERROR_CODES, UsernameOptions, username };
|
|
@@ -8,7 +8,7 @@ import "../../jwt-CmxZAGe2.mjs";
|
|
|
8
8
|
import "../../random-32E3cU5o.mjs";
|
|
9
9
|
import "../../cookies-BuvlgcA-.mjs";
|
|
10
10
|
import "../../date-CMr04reD.mjs";
|
|
11
|
-
import "../../db-
|
|
11
|
+
import "../../db-CV59HpEF.mjs";
|
|
12
12
|
import "../../dialect-HsWUfpYY.mjs";
|
|
13
13
|
import "../../get-tables-CKvSyDST.mjs";
|
|
14
14
|
import "../../types-DCPpFKUB.mjs";
|
|
@@ -36,6 +36,22 @@ async function verifySolution(nonce, solution, difficulty) {
|
|
|
36
36
|
return hasLeadingZeroBits(digest(nonce, solution), difficulty);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
+
* Lets the event loop run. Browsers slow timers down in background tabs, to
|
|
40
|
+
* once a second or less, which would stretch a solve from under a second to
|
|
41
|
+
* many seconds, so this waits on a message instead.
|
|
42
|
+
*/
|
|
43
|
+
function yieldToEventLoop() {
|
|
44
|
+
if (typeof MessageChannel === "undefined") return new Promise((resolve) => setTimeout(resolve, 0));
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
const channel = new MessageChannel();
|
|
47
|
+
channel.port1.onmessage = () => {
|
|
48
|
+
channel.port1.close();
|
|
49
|
+
resolve();
|
|
50
|
+
};
|
|
51
|
+
channel.port2.postMessage(null);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
39
55
|
* Find a solution for a challenge by trying incrementing counters. Yields to
|
|
40
56
|
* the event loop between batches, so solving doesn't block the page.
|
|
41
57
|
*/
|
|
@@ -43,7 +59,7 @@ async function solveChallenge(nonce, difficulty) {
|
|
|
43
59
|
for (let counter = 0;; counter++) {
|
|
44
60
|
const solution = counter.toString(36);
|
|
45
61
|
if (hasLeadingZeroBits(digest(nonce, solution), difficulty)) return solution;
|
|
46
|
-
if (counter % SOLVE_BATCH_SIZE === SOLVE_BATCH_SIZE - 1) await
|
|
62
|
+
if (counter % SOLVE_BATCH_SIZE === SOLVE_BATCH_SIZE - 1) await yieldToEventLoop();
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
/** Parses `<nonce>:<value>` header values */
|