@absolutejs/auth 0.75.4 → 0.75.6
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/cli/migrate.js +14 -7
- package/dist/cli/migrate.js.map +3 -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 +57 -43
- package/dist/index.js.map +7 -7
- package/dist/routes/protectRoute.d.ts +21 -4
- package/dist/routes/stepUp.d.ts +8 -3
- package/dist/server.js +57 -43
- package/dist/server.js.map +7 -7
- package/package.json +1 -1
|
@@ -14,14 +14,36 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
14
14
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
15
15
|
};
|
|
16
16
|
derive: {
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
readonly absoluteAuthStatus: {
|
|
18
|
+
error: {
|
|
19
|
+
readonly code: "Bad Request";
|
|
20
|
+
readonly message: "Cookies are missing";
|
|
21
|
+
};
|
|
22
|
+
user: null;
|
|
23
|
+
impersonator?: undefined;
|
|
21
24
|
} | {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
error: null;
|
|
26
|
+
impersonator: import("..").Impersonator | undefined;
|
|
27
|
+
user: AuthHtmxUser | null;
|
|
28
|
+
};
|
|
29
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
30
|
+
} & {
|
|
31
|
+
readonly protectRoute: {
|
|
32
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
33
|
+
readonly code: "Bad Request";
|
|
34
|
+
readonly message: "Cookies are missing";
|
|
35
|
+
} | {
|
|
36
|
+
readonly code: "Unauthorized";
|
|
37
|
+
readonly message: "User is not authenticated";
|
|
38
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
39
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
|
|
40
|
+
readonly code: "Bad Request";
|
|
41
|
+
readonly message: "Cookies are missing";
|
|
42
|
+
} | {
|
|
43
|
+
readonly code: "Unauthorized";
|
|
44
|
+
readonly message: "User is not authenticated";
|
|
45
|
+
}) => 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>>;
|
|
46
|
+
};
|
|
25
47
|
};
|
|
26
48
|
}, {
|
|
27
49
|
typebox: {};
|
|
@@ -38,14 +60,22 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
38
60
|
macroFn: {};
|
|
39
61
|
parser: {};
|
|
40
62
|
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
41
|
-
readonly
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
readonly protectRoute: {
|
|
64
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
65
|
+
readonly code: "Bad Request";
|
|
66
|
+
readonly message: "Cookies are missing";
|
|
67
|
+
} | {
|
|
68
|
+
readonly code: "Unauthorized";
|
|
69
|
+
readonly message: "User is not authenticated";
|
|
70
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
71
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
|
|
72
|
+
readonly code: "Bad Request";
|
|
73
|
+
readonly message: "Cookies are missing";
|
|
74
|
+
} | {
|
|
75
|
+
readonly code: "Unauthorized";
|
|
76
|
+
readonly message: "User is not authenticated";
|
|
77
|
+
}) => 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>>;
|
|
78
|
+
};
|
|
49
79
|
}>;
|
|
50
80
|
}, {
|
|
51
81
|
htmx: {
|
|
@@ -212,7 +242,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
212
242
|
query: unknown;
|
|
213
243
|
headers: unknown;
|
|
214
244
|
response: {
|
|
215
|
-
|
|
245
|
+
400: "Cookies are missing";
|
|
246
|
+
401: "User is not authenticated";
|
|
247
|
+
200: Response;
|
|
216
248
|
422: {
|
|
217
249
|
type: "validation";
|
|
218
250
|
title: "Validation Error";
|
|
@@ -241,7 +273,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
241
273
|
query: unknown;
|
|
242
274
|
headers: unknown;
|
|
243
275
|
response: {
|
|
244
|
-
|
|
276
|
+
400: "Cookies are missing";
|
|
277
|
+
401: "User is not authenticated";
|
|
278
|
+
200: Response;
|
|
245
279
|
422: {
|
|
246
280
|
type: "validation";
|
|
247
281
|
title: "Validation Error";
|
|
@@ -271,7 +305,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
271
305
|
query: unknown;
|
|
272
306
|
headers: unknown;
|
|
273
307
|
response: {
|
|
274
|
-
|
|
308
|
+
400: "Cookies are missing";
|
|
309
|
+
401: "User is not authenticated";
|
|
310
|
+
200: Response;
|
|
275
311
|
422: {
|
|
276
312
|
type: "validation";
|
|
277
313
|
title: "Validation Error";
|
|
@@ -300,7 +336,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
300
336
|
query: unknown;
|
|
301
337
|
headers: unknown;
|
|
302
338
|
response: {
|
|
303
|
-
|
|
339
|
+
400: "Cookies are missing";
|
|
340
|
+
401: "User is not authenticated";
|
|
341
|
+
200: Response;
|
|
304
342
|
422: {
|
|
305
343
|
type: "validation";
|
|
306
344
|
title: "Validation Error";
|
|
@@ -329,7 +367,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
329
367
|
query: unknown;
|
|
330
368
|
headers: unknown;
|
|
331
369
|
response: {
|
|
332
|
-
|
|
370
|
+
400: "Cookies are missing";
|
|
371
|
+
401: "User is not authenticated";
|
|
372
|
+
200: Response;
|
|
333
373
|
422: {
|
|
334
374
|
type: "validation";
|
|
335
375
|
title: "Validation Error";
|
|
@@ -386,7 +426,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
386
426
|
query: unknown;
|
|
387
427
|
headers: unknown;
|
|
388
428
|
response: {
|
|
389
|
-
|
|
429
|
+
400: "Cookies are missing";
|
|
430
|
+
401: "User is not authenticated";
|
|
431
|
+
200: Response;
|
|
390
432
|
422: {
|
|
391
433
|
type: "validation";
|
|
392
434
|
title: "Validation Error";
|
|
@@ -417,7 +459,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
417
459
|
query: unknown;
|
|
418
460
|
headers: unknown;
|
|
419
461
|
response: {
|
|
420
|
-
|
|
462
|
+
400: "Cookies are missing";
|
|
463
|
+
401: "User is not authenticated";
|
|
464
|
+
200: Response;
|
|
421
465
|
422: {
|
|
422
466
|
type: "validation";
|
|
423
467
|
title: "Validation Error";
|
|
@@ -469,7 +513,9 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
469
513
|
query: unknown;
|
|
470
514
|
headers: unknown;
|
|
471
515
|
response: {
|
|
472
|
-
|
|
516
|
+
400: "Cookies are missing";
|
|
517
|
+
401: "User is not authenticated";
|
|
518
|
+
200: Response;
|
|
473
519
|
422: {
|
|
474
520
|
type: "validation";
|
|
475
521
|
title: "Validation Error";
|
|
@@ -648,14 +694,36 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
648
694
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
649
695
|
};
|
|
650
696
|
derive: {
|
|
651
|
-
readonly
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
697
|
+
readonly absoluteAuthStatus: {
|
|
698
|
+
error: {
|
|
699
|
+
readonly code: "Bad Request";
|
|
700
|
+
readonly message: "Cookies are missing";
|
|
701
|
+
};
|
|
702
|
+
user: null;
|
|
703
|
+
impersonator?: undefined;
|
|
655
704
|
} | {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
705
|
+
error: null;
|
|
706
|
+
impersonator: import("..").Impersonator | undefined;
|
|
707
|
+
user: AuthHtmxUser | null;
|
|
708
|
+
};
|
|
709
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
710
|
+
} & {
|
|
711
|
+
readonly protectRoute: {
|
|
712
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
713
|
+
readonly code: "Bad Request";
|
|
714
|
+
readonly message: "Cookies are missing";
|
|
715
|
+
} | {
|
|
716
|
+
readonly code: "Unauthorized";
|
|
717
|
+
readonly message: "User is not authenticated";
|
|
718
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
719
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
|
|
720
|
+
readonly code: "Bad Request";
|
|
721
|
+
readonly message: "Cookies are missing";
|
|
722
|
+
} | {
|
|
723
|
+
readonly code: "Unauthorized";
|
|
724
|
+
readonly message: "User is not authenticated";
|
|
725
|
+
}) => 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>>;
|
|
726
|
+
};
|
|
659
727
|
};
|
|
660
728
|
} & {
|
|
661
729
|
derive: {};
|
|
@@ -668,12 +736,33 @@ export declare const createConfiguredAuthHtmxRoutes: <UserType>({ authSessionSto
|
|
|
668
736
|
session: import("..").SessionRecord<AuthHtmxUser>;
|
|
669
737
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
670
738
|
};
|
|
671
|
-
readonly
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
739
|
+
readonly absoluteAuthStatus: {
|
|
740
|
+
error: {
|
|
741
|
+
readonly code: "Bad Request";
|
|
742
|
+
readonly message: "Cookies are missing";
|
|
743
|
+
};
|
|
744
|
+
user: null;
|
|
745
|
+
impersonator?: undefined;
|
|
675
746
|
} | {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
747
|
+
error: null;
|
|
748
|
+
impersonator: import("..").Impersonator | undefined;
|
|
749
|
+
user: AuthHtmxUser | null;
|
|
750
|
+
};
|
|
751
|
+
readonly authPrincipal: import("..").AuthPrincipal<AuthHtmxUser> | undefined;
|
|
752
|
+
readonly protectRoute: {
|
|
753
|
+
<AuthReturn, AuthFailReturn = never>(handleAuth: (user: AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
754
|
+
readonly code: "Bad Request";
|
|
755
|
+
readonly message: "Cookies are missing";
|
|
756
|
+
} | {
|
|
757
|
+
readonly code: "Unauthorized";
|
|
758
|
+
readonly message: "User is not authenticated";
|
|
759
|
+
}) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
|
|
760
|
+
<AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
|
|
761
|
+
readonly code: "Bad Request";
|
|
762
|
+
readonly message: "Cookies are missing";
|
|
763
|
+
} | {
|
|
764
|
+
readonly code: "Unauthorized";
|
|
765
|
+
readonly message: "User is not authenticated";
|
|
766
|
+
}) => 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>>;
|
|
767
|
+
};
|
|
679
768
|
}) => Promise<Response>>;
|
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>>;
|