@absolutejs/auth 0.68.2 → 0.69.1
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/README.md +69 -0
- package/dist/authContext.d.ts +9 -4
- package/dist/cli/migrate.js +37 -8
- package/dist/cli/migrate.js.map +4 -4
- package/dist/client/createAuthClient.d.ts +28 -2
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +542 -8
- package/dist/client/index.js.map +5 -4
- package/dist/client/mobile.d.ts +84 -0
- package/dist/client/mobile.js +572 -0
- package/dist/client/mobile.js.map +10 -0
- package/dist/htmx/configuredRoutes.d.ts +16 -28
- package/dist/htmx/routes.d.ts +16 -28
- package/dist/index.d.ts +221 -34
- package/dist/index.js +1855 -1401
- package/dist/index.js.map +16 -12
- package/dist/oidc/config.d.ts +17 -2
- package/dist/oidc/inMemoryStores.d.ts +2 -1
- package/dist/oidc/index.d.ts +4 -2
- package/dist/oidc/index.js +589 -6
- package/dist/oidc/index.js.map +8 -4
- package/dist/oidc/nativeClients.d.ts +11 -0
- package/dist/oidc/postgresStores.d.ts +145 -1
- package/dist/oidc/socketTicketRoutes.d.ts +7 -0
- package/dist/oidc/socketTickets.d.ts +21 -0
- package/dist/oidc/types.d.ts +20 -0
- package/dist/principal.d.ts +39 -0
- package/dist/routes/protectRoute.d.ts +7 -3
- package/dist/routes/requireAuth.d.ts +4 -1
- package/dist/server.js +1843 -1400
- package/dist/server.js.map +16 -12
- package/package.json +10 -2
|
@@ -14,13 +14,14 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
14
14
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
15
15
|
};
|
|
16
16
|
derive: {
|
|
17
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
17
18
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
18
19
|
readonly code: "Bad Request";
|
|
19
20
|
readonly message: "Cookies are missing";
|
|
20
21
|
} | {
|
|
21
22
|
readonly code: "Unauthorized";
|
|
22
23
|
readonly message: "User is not authenticated";
|
|
23
|
-
}) => AuthFailReturn) | undefined) =>
|
|
24
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
24
25
|
};
|
|
25
26
|
}, {
|
|
26
27
|
typebox: {};
|
|
@@ -37,13 +38,14 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
37
38
|
macroFn: {};
|
|
38
39
|
parser: {};
|
|
39
40
|
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
41
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
40
42
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
41
43
|
readonly code: "Bad Request";
|
|
42
44
|
readonly message: "Cookies are missing";
|
|
43
45
|
} | {
|
|
44
46
|
readonly code: "Unauthorized";
|
|
45
47
|
readonly message: "User is not authenticated";
|
|
46
|
-
}) => AuthFailReturn) | undefined) =>
|
|
48
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
47
49
|
}>;
|
|
48
50
|
}, {
|
|
49
51
|
htmx: {
|
|
@@ -210,9 +212,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
210
212
|
query: unknown;
|
|
211
213
|
headers: unknown;
|
|
212
214
|
response: {
|
|
213
|
-
|
|
214
|
-
401: "User is not authenticated";
|
|
215
|
-
200: Response;
|
|
215
|
+
200: {};
|
|
216
216
|
422: {
|
|
217
217
|
type: "validation";
|
|
218
218
|
title: "Validation Error";
|
|
@@ -241,9 +241,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
241
241
|
query: unknown;
|
|
242
242
|
headers: unknown;
|
|
243
243
|
response: {
|
|
244
|
-
|
|
245
|
-
401: "User is not authenticated";
|
|
246
|
-
200: Response;
|
|
244
|
+
200: {};
|
|
247
245
|
422: {
|
|
248
246
|
type: "validation";
|
|
249
247
|
title: "Validation Error";
|
|
@@ -273,9 +271,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
273
271
|
query: unknown;
|
|
274
272
|
headers: unknown;
|
|
275
273
|
response: {
|
|
276
|
-
|
|
277
|
-
401: "User is not authenticated";
|
|
278
|
-
200: Response;
|
|
274
|
+
200: {};
|
|
279
275
|
422: {
|
|
280
276
|
type: "validation";
|
|
281
277
|
title: "Validation Error";
|
|
@@ -304,9 +300,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
304
300
|
query: unknown;
|
|
305
301
|
headers: unknown;
|
|
306
302
|
response: {
|
|
307
|
-
|
|
308
|
-
401: "User is not authenticated";
|
|
309
|
-
200: Response;
|
|
303
|
+
200: {};
|
|
310
304
|
422: {
|
|
311
305
|
type: "validation";
|
|
312
306
|
title: "Validation Error";
|
|
@@ -335,9 +329,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
335
329
|
query: unknown;
|
|
336
330
|
headers: unknown;
|
|
337
331
|
response: {
|
|
338
|
-
|
|
339
|
-
401: "User is not authenticated";
|
|
340
|
-
200: Response;
|
|
332
|
+
200: {};
|
|
341
333
|
422: {
|
|
342
334
|
type: "validation";
|
|
343
335
|
title: "Validation Error";
|
|
@@ -394,9 +386,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
394
386
|
query: unknown;
|
|
395
387
|
headers: unknown;
|
|
396
388
|
response: {
|
|
397
|
-
|
|
398
|
-
401: "User is not authenticated";
|
|
399
|
-
200: Response;
|
|
389
|
+
200: {};
|
|
400
390
|
422: {
|
|
401
391
|
type: "validation";
|
|
402
392
|
title: "Validation Error";
|
|
@@ -427,9 +417,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
427
417
|
query: unknown;
|
|
428
418
|
headers: unknown;
|
|
429
419
|
response: {
|
|
430
|
-
|
|
431
|
-
401: "User is not authenticated";
|
|
432
|
-
200: Response;
|
|
420
|
+
200: {};
|
|
433
421
|
422: {
|
|
434
422
|
type: "validation";
|
|
435
423
|
title: "Validation Error";
|
|
@@ -481,9 +469,7 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
481
469
|
query: unknown;
|
|
482
470
|
headers: unknown;
|
|
483
471
|
response: {
|
|
484
|
-
|
|
485
|
-
401: "User is not authenticated";
|
|
486
|
-
200: Response;
|
|
472
|
+
200: {};
|
|
487
473
|
422: {
|
|
488
474
|
type: "validation";
|
|
489
475
|
title: "Validation Error";
|
|
@@ -662,13 +648,14 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
662
648
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
663
649
|
};
|
|
664
650
|
derive: {
|
|
651
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
665
652
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
666
653
|
readonly code: "Bad Request";
|
|
667
654
|
readonly message: "Cookies are missing";
|
|
668
655
|
} | {
|
|
669
656
|
readonly code: "Unauthorized";
|
|
670
657
|
readonly message: "User is not authenticated";
|
|
671
|
-
}) => AuthFailReturn) | undefined) =>
|
|
658
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
672
659
|
};
|
|
673
660
|
} & {
|
|
674
661
|
derive: {};
|
|
@@ -681,11 +668,12 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
681
668
|
session: import("..").SessionRecord<AuthHtmxUser>;
|
|
682
669
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
683
670
|
};
|
|
671
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
684
672
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
685
673
|
readonly code: "Bad Request";
|
|
686
674
|
readonly message: "Cookies are missing";
|
|
687
675
|
} | {
|
|
688
676
|
readonly code: "Unauthorized";
|
|
689
677
|
readonly message: "User is not authenticated";
|
|
690
|
-
}) => AuthFailReturn) | undefined) =>
|
|
678
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
691
679
|
}) => Promise<Response>>;
|
package/dist/htmx/routes.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
9
9
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
10
10
|
};
|
|
11
11
|
derive: {
|
|
12
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
12
13
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
13
14
|
readonly code: "Bad Request";
|
|
14
15
|
readonly message: "Cookies are missing";
|
|
15
16
|
} | {
|
|
16
17
|
readonly code: "Unauthorized";
|
|
17
18
|
readonly message: "User is not authenticated";
|
|
18
|
-
}) => AuthFailReturn) | undefined) =>
|
|
19
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
19
20
|
};
|
|
20
21
|
}, {
|
|
21
22
|
typebox: {};
|
|
@@ -32,13 +33,14 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
32
33
|
macroFn: {};
|
|
33
34
|
parser: {};
|
|
34
35
|
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
36
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
35
37
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
36
38
|
readonly code: "Bad Request";
|
|
37
39
|
readonly message: "Cookies are missing";
|
|
38
40
|
} | {
|
|
39
41
|
readonly code: "Unauthorized";
|
|
40
42
|
readonly message: "User is not authenticated";
|
|
41
|
-
}) => AuthFailReturn) | undefined) =>
|
|
43
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
42
44
|
}>;
|
|
43
45
|
}, {
|
|
44
46
|
htmx: {
|
|
@@ -205,9 +207,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
205
207
|
query: unknown;
|
|
206
208
|
headers: unknown;
|
|
207
209
|
response: {
|
|
208
|
-
|
|
209
|
-
401: "User is not authenticated";
|
|
210
|
-
200: Response;
|
|
210
|
+
200: {};
|
|
211
211
|
422: {
|
|
212
212
|
type: "validation";
|
|
213
213
|
title: "Validation Error";
|
|
@@ -236,9 +236,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
236
236
|
query: unknown;
|
|
237
237
|
headers: unknown;
|
|
238
238
|
response: {
|
|
239
|
-
|
|
240
|
-
401: "User is not authenticated";
|
|
241
|
-
200: Response;
|
|
239
|
+
200: {};
|
|
242
240
|
422: {
|
|
243
241
|
type: "validation";
|
|
244
242
|
title: "Validation Error";
|
|
@@ -268,9 +266,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
268
266
|
query: unknown;
|
|
269
267
|
headers: unknown;
|
|
270
268
|
response: {
|
|
271
|
-
|
|
272
|
-
401: "User is not authenticated";
|
|
273
|
-
200: Response;
|
|
269
|
+
200: {};
|
|
274
270
|
422: {
|
|
275
271
|
type: "validation";
|
|
276
272
|
title: "Validation Error";
|
|
@@ -299,9 +295,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
299
295
|
query: unknown;
|
|
300
296
|
headers: unknown;
|
|
301
297
|
response: {
|
|
302
|
-
|
|
303
|
-
401: "User is not authenticated";
|
|
304
|
-
200: Response;
|
|
298
|
+
200: {};
|
|
305
299
|
422: {
|
|
306
300
|
type: "validation";
|
|
307
301
|
title: "Validation Error";
|
|
@@ -330,9 +324,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
330
324
|
query: unknown;
|
|
331
325
|
headers: unknown;
|
|
332
326
|
response: {
|
|
333
|
-
|
|
334
|
-
401: "User is not authenticated";
|
|
335
|
-
200: Response;
|
|
327
|
+
200: {};
|
|
336
328
|
422: {
|
|
337
329
|
type: "validation";
|
|
338
330
|
title: "Validation Error";
|
|
@@ -389,9 +381,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
389
381
|
query: unknown;
|
|
390
382
|
headers: unknown;
|
|
391
383
|
response: {
|
|
392
|
-
|
|
393
|
-
401: "User is not authenticated";
|
|
394
|
-
200: Response;
|
|
384
|
+
200: {};
|
|
395
385
|
422: {
|
|
396
386
|
type: "validation";
|
|
397
387
|
title: "Validation Error";
|
|
@@ -422,9 +412,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
422
412
|
query: unknown;
|
|
423
413
|
headers: unknown;
|
|
424
414
|
response: {
|
|
425
|
-
|
|
426
|
-
401: "User is not authenticated";
|
|
427
|
-
200: Response;
|
|
415
|
+
200: {};
|
|
428
416
|
422: {
|
|
429
417
|
type: "validation";
|
|
430
418
|
title: "Validation Error";
|
|
@@ -476,9 +464,7 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
476
464
|
query: unknown;
|
|
477
465
|
headers: unknown;
|
|
478
466
|
response: {
|
|
479
|
-
|
|
480
|
-
401: "User is not authenticated";
|
|
481
|
-
200: Response;
|
|
467
|
+
200: {};
|
|
482
468
|
422: {
|
|
483
469
|
type: "validation";
|
|
484
470
|
title: "Validation Error";
|
|
@@ -657,13 +643,14 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
657
643
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
658
644
|
};
|
|
659
645
|
derive: {
|
|
646
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
660
647
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
661
648
|
readonly code: "Bad Request";
|
|
662
649
|
readonly message: "Cookies are missing";
|
|
663
650
|
} | {
|
|
664
651
|
readonly code: "Unauthorized";
|
|
665
652
|
readonly message: "User is not authenticated";
|
|
666
|
-
}) => AuthFailReturn) | undefined) =>
|
|
653
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
667
654
|
};
|
|
668
655
|
} & {
|
|
669
656
|
derive: {};
|
|
@@ -676,11 +663,12 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
676
663
|
session: import("..").SessionRecord<UserType>;
|
|
677
664
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
678
665
|
};
|
|
666
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
679
667
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
680
668
|
readonly code: "Bad Request";
|
|
681
669
|
readonly message: "Cookies are missing";
|
|
682
670
|
} | {
|
|
683
671
|
readonly code: "Unauthorized";
|
|
684
672
|
readonly message: "User is not authenticated";
|
|
685
|
-
}) => AuthFailReturn) | undefined) =>
|
|
673
|
+
}) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
|
|
686
674
|
}) => Promise<Response>>;
|