@absolutejs/auth 0.75.3 → 0.75.5
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/agents/context.d.ts +6 -2
- package/dist/agents/index.js +6 -5
- package/dist/agents/index.js.map +3 -3
- package/dist/agents/routes.d.ts +10 -4
- package/dist/authContext.d.ts +178 -66
- package/dist/authorization/protectPermission.d.ts +8 -3
- package/dist/htmx/configuredRoutes.d.ts +126 -37
- package/dist/htmx/routes.d.ts +126 -37
- package/dist/index.d.ts +432 -162
- package/dist/index.js +44 -37
- package/dist/index.js.map +6 -6
- package/dist/routes/protectRoute.d.ts +21 -4
- package/dist/routes/stepUp.d.ts +8 -3
- package/dist/server.js +44 -37
- package/dist/server.js.map +6 -6
- package/package.json +1 -1
- package/dist/client/dpop.test.d.ts +0 -1
package/dist/htmx/routes.d.ts
CHANGED
|
@@ -9,14 +9,36 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
9
9
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
10
10
|
};
|
|
11
11
|
derive: {
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
readonly absoluteAuthStatus: {
|
|
13
|
+
error: {
|
|
14
|
+
readonly code: "Bad Request";
|
|
15
|
+
readonly message: "Cookies are missing";
|
|
16
|
+
};
|
|
17
|
+
user: null;
|
|
18
|
+
impersonator?: undefined;
|
|
16
19
|
} | {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
error: null;
|
|
21
|
+
impersonator: import("..").Impersonator | undefined;
|
|
22
|
+
user: NonNullable<UserType> | null;
|
|
23
|
+
};
|
|
24
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
readonly protectRoute: {
|
|
27
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
28
|
+
readonly code: "Bad Request";
|
|
29
|
+
readonly message: "Cookies are missing";
|
|
30
|
+
} | {
|
|
31
|
+
readonly code: "Unauthorized";
|
|
32
|
+
readonly message: "User is not authenticated";
|
|
33
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
34
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
|
|
35
|
+
readonly code: "Bad Request";
|
|
36
|
+
readonly message: "Cookies are missing";
|
|
37
|
+
} | {
|
|
38
|
+
readonly code: "Unauthorized";
|
|
39
|
+
readonly message: "User is not authenticated";
|
|
40
|
+
}) => AuthFailReturn_1) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_1>>;
|
|
41
|
+
};
|
|
20
42
|
};
|
|
21
43
|
}, {
|
|
22
44
|
typebox: {};
|
|
@@ -33,14 +55,22 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
33
55
|
macroFn: {};
|
|
34
56
|
parser: {};
|
|
35
57
|
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
readonly protectRoute: {
|
|
59
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
60
|
+
readonly code: "Bad Request";
|
|
61
|
+
readonly message: "Cookies are missing";
|
|
62
|
+
} | {
|
|
63
|
+
readonly code: "Unauthorized";
|
|
64
|
+
readonly message: "User is not authenticated";
|
|
65
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
66
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
|
|
67
|
+
readonly code: "Bad Request";
|
|
68
|
+
readonly message: "Cookies are missing";
|
|
69
|
+
} | {
|
|
70
|
+
readonly code: "Unauthorized";
|
|
71
|
+
readonly message: "User is not authenticated";
|
|
72
|
+
}) => AuthFailReturn_1) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_1>>;
|
|
73
|
+
};
|
|
44
74
|
}>;
|
|
45
75
|
}, {
|
|
46
76
|
htmx: {
|
|
@@ -207,7 +237,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
207
237
|
query: unknown;
|
|
208
238
|
headers: unknown;
|
|
209
239
|
response: {
|
|
210
|
-
|
|
240
|
+
400: "Cookies are missing";
|
|
241
|
+
401: "User is not authenticated";
|
|
242
|
+
200: Response;
|
|
211
243
|
422: {
|
|
212
244
|
type: "validation";
|
|
213
245
|
title: "Validation Error";
|
|
@@ -236,7 +268,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
236
268
|
query: unknown;
|
|
237
269
|
headers: unknown;
|
|
238
270
|
response: {
|
|
239
|
-
|
|
271
|
+
400: "Cookies are missing";
|
|
272
|
+
401: "User is not authenticated";
|
|
273
|
+
200: Response;
|
|
240
274
|
422: {
|
|
241
275
|
type: "validation";
|
|
242
276
|
title: "Validation Error";
|
|
@@ -266,7 +300,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
266
300
|
query: unknown;
|
|
267
301
|
headers: unknown;
|
|
268
302
|
response: {
|
|
269
|
-
|
|
303
|
+
400: "Cookies are missing";
|
|
304
|
+
401: "User is not authenticated";
|
|
305
|
+
200: Response;
|
|
270
306
|
422: {
|
|
271
307
|
type: "validation";
|
|
272
308
|
title: "Validation Error";
|
|
@@ -295,7 +331,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
295
331
|
query: unknown;
|
|
296
332
|
headers: unknown;
|
|
297
333
|
response: {
|
|
298
|
-
|
|
334
|
+
400: "Cookies are missing";
|
|
335
|
+
401: "User is not authenticated";
|
|
336
|
+
200: Response;
|
|
299
337
|
422: {
|
|
300
338
|
type: "validation";
|
|
301
339
|
title: "Validation Error";
|
|
@@ -324,7 +362,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
324
362
|
query: unknown;
|
|
325
363
|
headers: unknown;
|
|
326
364
|
response: {
|
|
327
|
-
|
|
365
|
+
400: "Cookies are missing";
|
|
366
|
+
401: "User is not authenticated";
|
|
367
|
+
200: Response;
|
|
328
368
|
422: {
|
|
329
369
|
type: "validation";
|
|
330
370
|
title: "Validation Error";
|
|
@@ -381,7 +421,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
381
421
|
query: unknown;
|
|
382
422
|
headers: unknown;
|
|
383
423
|
response: {
|
|
384
|
-
|
|
424
|
+
400: "Cookies are missing";
|
|
425
|
+
401: "User is not authenticated";
|
|
426
|
+
200: Response;
|
|
385
427
|
422: {
|
|
386
428
|
type: "validation";
|
|
387
429
|
title: "Validation Error";
|
|
@@ -412,7 +454,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
412
454
|
query: unknown;
|
|
413
455
|
headers: unknown;
|
|
414
456
|
response: {
|
|
415
|
-
|
|
457
|
+
400: "Cookies are missing";
|
|
458
|
+
401: "User is not authenticated";
|
|
459
|
+
200: Response;
|
|
416
460
|
422: {
|
|
417
461
|
type: "validation";
|
|
418
462
|
title: "Validation Error";
|
|
@@ -464,7 +508,9 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
464
508
|
query: unknown;
|
|
465
509
|
headers: unknown;
|
|
466
510
|
response: {
|
|
467
|
-
|
|
511
|
+
400: "Cookies are missing";
|
|
512
|
+
401: "User is not authenticated";
|
|
513
|
+
200: Response;
|
|
468
514
|
422: {
|
|
469
515
|
type: "validation";
|
|
470
516
|
title: "Validation Error";
|
|
@@ -643,14 +689,36 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
643
689
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
644
690
|
};
|
|
645
691
|
derive: {
|
|
646
|
-
readonly
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
692
|
+
readonly absoluteAuthStatus: {
|
|
693
|
+
error: {
|
|
694
|
+
readonly code: "Bad Request";
|
|
695
|
+
readonly message: "Cookies are missing";
|
|
696
|
+
};
|
|
697
|
+
user: null;
|
|
698
|
+
impersonator?: undefined;
|
|
650
699
|
} | {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
700
|
+
error: null;
|
|
701
|
+
impersonator: import("..").Impersonator | undefined;
|
|
702
|
+
user: NonNullable<UserType> | null;
|
|
703
|
+
};
|
|
704
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
705
|
+
} & {
|
|
706
|
+
readonly protectRoute: {
|
|
707
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
708
|
+
readonly code: "Bad Request";
|
|
709
|
+
readonly message: "Cookies are missing";
|
|
710
|
+
} | {
|
|
711
|
+
readonly code: "Unauthorized";
|
|
712
|
+
readonly message: "User is not authenticated";
|
|
713
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
714
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
|
|
715
|
+
readonly code: "Bad Request";
|
|
716
|
+
readonly message: "Cookies are missing";
|
|
717
|
+
} | {
|
|
718
|
+
readonly code: "Unauthorized";
|
|
719
|
+
readonly message: "User is not authenticated";
|
|
720
|
+
}) => AuthFailReturn_1) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_1>>;
|
|
721
|
+
};
|
|
654
722
|
};
|
|
655
723
|
} & {
|
|
656
724
|
derive: {};
|
|
@@ -663,12 +731,33 @@ export declare const createAuthHtmxRoutes: <UserType extends AuthHtmxUser>(confi
|
|
|
663
731
|
session: import("..").SessionRecord<UserType>;
|
|
664
732
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
665
733
|
};
|
|
666
|
-
readonly
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
734
|
+
readonly absoluteAuthStatus: {
|
|
735
|
+
error: {
|
|
736
|
+
readonly code: "Bad Request";
|
|
737
|
+
readonly message: "Cookies are missing";
|
|
738
|
+
};
|
|
739
|
+
user: null;
|
|
740
|
+
impersonator?: undefined;
|
|
670
741
|
} | {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
742
|
+
error: null;
|
|
743
|
+
impersonator: import("..").Impersonator | undefined;
|
|
744
|
+
user: NonNullable<UserType> | null;
|
|
745
|
+
};
|
|
746
|
+
readonly authPrincipal: import("..").AuthPrincipal<UserType> | undefined;
|
|
747
|
+
readonly protectRoute: {
|
|
748
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
749
|
+
readonly code: "Bad Request";
|
|
750
|
+
readonly message: "Cookies are missing";
|
|
751
|
+
} | {
|
|
752
|
+
readonly code: "Unauthorized";
|
|
753
|
+
readonly message: "User is not authenticated";
|
|
754
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
755
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
|
|
756
|
+
readonly code: "Bad Request";
|
|
757
|
+
readonly message: "Cookies are missing";
|
|
758
|
+
} | {
|
|
759
|
+
readonly code: "Unauthorized";
|
|
760
|
+
readonly message: "User is not authenticated";
|
|
761
|
+
}) => AuthFailReturn_1) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_1>>;
|
|
762
|
+
};
|
|
674
763
|
}) => Promise<Response>>;
|