@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/index.d.ts CHANGED
@@ -9,54 +9,134 @@ export declare const auth: <UserType>(configuration: AuthConfig<UserType>) => Pr
9
9
  unregisteredSession: import("./types").UnregisteredSessionRecord;
10
10
  };
11
11
  derive: ({
12
+ readonly absoluteAuthStatus: {
13
+ error: {
14
+ readonly code: "Bad Request";
15
+ readonly message: "Cookies are missing";
16
+ };
17
+ user: null;
18
+ impersonator?: undefined;
19
+ } | {
20
+ error: null;
21
+ impersonator: import("./types").Impersonator | undefined;
22
+ user: NonNullable<UserType> | null;
23
+ };
12
24
  readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
13
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
14
- readonly code: "Bad Request";
15
- readonly message: "Cookies are missing";
16
- } | {
17
- readonly code: "Unauthorized";
18
- readonly message: "User is not authenticated";
19
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
20
- } & {
21
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
22
- readonly code: "Unauthorized";
23
- readonly message: "Recent authentication required";
24
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
25
- } & {
26
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
27
- code: "Forbidden" | "Unauthorized";
28
- message: "Agent is not authenticated" | "Insufficient agent scopes";
29
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
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
+ };
42
+ } & {
43
+ readonly requireRecentAuth: {
44
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
45
+ readonly code: "Unauthorized";
46
+ readonly message: "Recent authentication required";
47
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
48
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
49
+ readonly code: "Unauthorized";
50
+ readonly message: "Recent authentication required";
51
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
52
+ };
53
+ } & {
54
+ readonly protectAgent: {
55
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
56
+ code: "Forbidden" | "Unauthorized";
57
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
58
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
59
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
60
+ code: "Forbidden" | "Unauthorized";
61
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
62
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
63
+ };
30
64
  }) | ({
65
+ readonly absoluteAuthStatus: {
66
+ error: {
67
+ readonly code: "Bad Request";
68
+ readonly message: "Cookies are missing";
69
+ };
70
+ user: null;
71
+ impersonator?: undefined;
72
+ } | {
73
+ error: null;
74
+ impersonator: import("./types").Impersonator | undefined;
75
+ user: NonNullable<UserType> | null;
76
+ };
31
77
  readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
32
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | 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) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
39
- } & {
40
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
41
- readonly code: "Unauthorized";
42
- readonly message: "Recent authentication required";
43
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
44
- } & {
45
- readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
46
- readonly code: "Bad Request";
47
- readonly message: "Cookies are missing";
48
- } | {
49
- readonly code: "Forbidden";
50
- readonly message: "Insufficient permissions";
51
- } | {
52
- readonly code: "Unauthorized";
53
- readonly message: "User is not authenticated";
54
- }) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
55
- } & {
56
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
57
- code: "Forbidden" | "Unauthorized";
58
- message: "Agent is not authenticated" | "Insufficient agent scopes";
59
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
78
+ } & {
79
+ readonly protectRoute: {
80
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
81
+ readonly code: "Bad Request";
82
+ readonly message: "Cookies are missing";
83
+ } | {
84
+ readonly code: "Unauthorized";
85
+ readonly message: "User is not authenticated";
86
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
87
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
88
+ readonly code: "Bad Request";
89
+ readonly message: "Cookies are missing";
90
+ } | {
91
+ readonly code: "Unauthorized";
92
+ readonly message: "User is not authenticated";
93
+ }) => 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>>;
94
+ };
95
+ } & {
96
+ readonly requireRecentAuth: {
97
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
98
+ readonly code: "Unauthorized";
99
+ readonly message: "Recent authentication required";
100
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
101
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
102
+ readonly code: "Unauthorized";
103
+ readonly message: "Recent authentication required";
104
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
105
+ };
106
+ } & {
107
+ readonly protectPermission: {
108
+ <AuthReturn, AuthFailReturn_6 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
109
+ readonly code: "Bad Request";
110
+ readonly message: "Cookies are missing";
111
+ } | {
112
+ readonly code: "Forbidden";
113
+ readonly message: "Insufficient permissions";
114
+ } | {
115
+ readonly code: "Unauthorized";
116
+ readonly message: "User is not authenticated";
117
+ }) => AuthFailReturn_6) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_6>>;
118
+ <AuthReturn, AuthFailReturn_7 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
119
+ readonly code: "Bad Request";
120
+ readonly message: "Cookies are missing";
121
+ } | {
122
+ readonly code: "Forbidden";
123
+ readonly message: "Insufficient permissions";
124
+ } | {
125
+ readonly code: "Unauthorized";
126
+ readonly message: "User is not authenticated";
127
+ }) => AuthFailReturn_7) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_7>>;
128
+ };
129
+ } & {
130
+ readonly protectAgent: {
131
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
132
+ code: "Forbidden" | "Unauthorized";
133
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
134
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
135
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
136
+ code: "Forbidden" | "Unauthorized";
137
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
138
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
139
+ };
60
140
  });
61
141
  }, {
62
142
  typebox: {};
@@ -80,14 +160,22 @@ export declare const auth: <UserType>(configuration: AuthConfig<UserType>) => Pr
80
160
  macroFn: {};
81
161
  parser: {};
82
162
  response: import("elysia/types").ExtractErrorFromHandle<{
83
- readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
84
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
85
- readonly code: "Bad Request";
86
- readonly message: "Cookies are missing";
87
- } | {
88
- readonly code: "Unauthorized";
89
- readonly message: "User is not authenticated";
90
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
163
+ readonly protectRoute: {
164
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
165
+ readonly code: "Bad Request";
166
+ readonly message: "Cookies are missing";
167
+ } | {
168
+ readonly code: "Unauthorized";
169
+ readonly message: "User is not authenticated";
170
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
171
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
172
+ readonly code: "Bad Request";
173
+ readonly message: "Cookies are missing";
174
+ } | {
175
+ readonly code: "Unauthorized";
176
+ readonly message: "User is not authenticated";
177
+ }) => 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>>;
178
+ };
91
179
  }>;
92
180
  } & ({
93
181
  schema: {};
@@ -101,10 +189,16 @@ export declare const auth: <UserType>(configuration: AuthConfig<UserType>) => Pr
101
189
  macroFn: {};
102
190
  parser: {};
103
191
  response: import("elysia/types").ExtractErrorFromHandle<{
104
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
105
- readonly code: "Unauthorized";
106
- readonly message: "Recent authentication required";
107
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
192
+ readonly requireRecentAuth: {
193
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
194
+ readonly code: "Unauthorized";
195
+ readonly message: "Recent authentication required";
196
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
197
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
198
+ readonly code: "Unauthorized";
199
+ readonly message: "Recent authentication required";
200
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
201
+ };
108
202
  }>;
109
203
  } & (import("elysia/types").DefaultMetadata | {
110
204
  schema: {};
@@ -118,16 +212,28 @@ export declare const auth: <UserType>(configuration: AuthConfig<UserType>) => Pr
118
212
  macroFn: {};
119
213
  parser: {};
120
214
  response: import("elysia/types").ExtractErrorFromHandle<{
121
- readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
122
- readonly code: "Bad Request";
123
- readonly message: "Cookies are missing";
124
- } | {
125
- readonly code: "Forbidden";
126
- readonly message: "Insufficient permissions";
127
- } | {
128
- readonly code: "Unauthorized";
129
- readonly message: "User is not authenticated";
130
- }) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
215
+ readonly protectPermission: {
216
+ <AuthReturn, AuthFailReturn_6 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
217
+ readonly code: "Bad Request";
218
+ readonly message: "Cookies are missing";
219
+ } | {
220
+ readonly code: "Forbidden";
221
+ readonly message: "Insufficient permissions";
222
+ } | {
223
+ readonly code: "Unauthorized";
224
+ readonly message: "User is not authenticated";
225
+ }) => AuthFailReturn_6) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_6>>;
226
+ <AuthReturn, AuthFailReturn_7 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
227
+ readonly code: "Bad Request";
228
+ readonly message: "Cookies are missing";
229
+ } | {
230
+ readonly code: "Forbidden";
231
+ readonly message: "Insufficient permissions";
232
+ } | {
233
+ readonly code: "Unauthorized";
234
+ readonly message: "User is not authenticated";
235
+ }) => AuthFailReturn_7) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_7>>;
236
+ };
131
237
  }>;
132
238
  }))))) & {
133
239
  schema: {};
@@ -136,10 +242,16 @@ export declare const auth: <UserType>(configuration: AuthConfig<UserType>) => Pr
136
242
  macroFn: {};
137
243
  parser: {};
138
244
  response: import("elysia/types").ExtractErrorFromHandle<{
139
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
140
- code: "Forbidden" | "Unauthorized";
141
- message: "Agent is not authenticated" | "Insufficient agent scopes";
142
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
245
+ readonly protectAgent: {
246
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
247
+ code: "Forbidden" | "Unauthorized";
248
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
249
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
250
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
251
+ code: "Forbidden" | "Unauthorized";
252
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
253
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
254
+ };
143
255
  }>;
144
256
  }), {}, import("elysia/types").DefaultEphemeral, {
145
257
  derive: {};
@@ -159,54 +271,134 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
159
271
  unregisteredSession: import("./types").UnregisteredSessionRecord;
160
272
  };
161
273
  derive: ({
162
- readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
163
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
164
- readonly code: "Bad Request";
165
- readonly message: "Cookies are missing";
274
+ readonly absoluteAuthStatus: {
275
+ error: {
276
+ readonly code: "Bad Request";
277
+ readonly message: "Cookies are missing";
278
+ };
279
+ user: null;
280
+ impersonator?: undefined;
166
281
  } | {
167
- readonly code: "Unauthorized";
168
- readonly message: "User is not authenticated";
169
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
282
+ error: null;
283
+ impersonator: import("./types").Impersonator | undefined;
284
+ user: NonNullable<UserType> | null;
285
+ };
286
+ readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
170
287
  } & {
171
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
172
- readonly code: "Unauthorized";
173
- readonly message: "Recent authentication required";
174
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
288
+ readonly protectRoute: {
289
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
290
+ readonly code: "Bad Request";
291
+ readonly message: "Cookies are missing";
292
+ } | {
293
+ readonly code: "Unauthorized";
294
+ readonly message: "User is not authenticated";
295
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
296
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
297
+ readonly code: "Bad Request";
298
+ readonly message: "Cookies are missing";
299
+ } | {
300
+ readonly code: "Unauthorized";
301
+ readonly message: "User is not authenticated";
302
+ }) => 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>>;
303
+ };
175
304
  } & {
176
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
177
- code: "Forbidden" | "Unauthorized";
178
- message: "Agent is not authenticated" | "Insufficient agent scopes";
179
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
305
+ readonly requireRecentAuth: {
306
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
307
+ readonly code: "Unauthorized";
308
+ readonly message: "Recent authentication required";
309
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
310
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
311
+ readonly code: "Unauthorized";
312
+ readonly message: "Recent authentication required";
313
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
314
+ };
315
+ } & {
316
+ readonly protectAgent: {
317
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
318
+ code: "Forbidden" | "Unauthorized";
319
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
320
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
321
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
322
+ code: "Forbidden" | "Unauthorized";
323
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
324
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
325
+ };
180
326
  }) | ({
181
- readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
182
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
183
- readonly code: "Bad Request";
184
- readonly message: "Cookies are missing";
327
+ readonly absoluteAuthStatus: {
328
+ error: {
329
+ readonly code: "Bad Request";
330
+ readonly message: "Cookies are missing";
331
+ };
332
+ user: null;
333
+ impersonator?: undefined;
185
334
  } | {
186
- readonly code: "Unauthorized";
187
- readonly message: "User is not authenticated";
188
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
335
+ error: null;
336
+ impersonator: import("./types").Impersonator | undefined;
337
+ user: NonNullable<UserType> | null;
338
+ };
339
+ readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
189
340
  } & {
190
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
191
- readonly code: "Unauthorized";
192
- readonly message: "Recent authentication required";
193
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
341
+ readonly protectRoute: {
342
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
343
+ readonly code: "Bad Request";
344
+ readonly message: "Cookies are missing";
345
+ } | {
346
+ readonly code: "Unauthorized";
347
+ readonly message: "User is not authenticated";
348
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
349
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
350
+ readonly code: "Bad Request";
351
+ readonly message: "Cookies are missing";
352
+ } | {
353
+ readonly code: "Unauthorized";
354
+ readonly message: "User is not authenticated";
355
+ }) => 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>>;
356
+ };
194
357
  } & {
195
- readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
196
- readonly code: "Bad Request";
197
- readonly message: "Cookies are missing";
198
- } | {
199
- readonly code: "Forbidden";
200
- readonly message: "Insufficient permissions";
201
- } | {
202
- readonly code: "Unauthorized";
203
- readonly message: "User is not authenticated";
204
- }) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
358
+ readonly requireRecentAuth: {
359
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
360
+ readonly code: "Unauthorized";
361
+ readonly message: "Recent authentication required";
362
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
363
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
364
+ readonly code: "Unauthorized";
365
+ readonly message: "Recent authentication required";
366
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
367
+ };
205
368
  } & {
206
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
207
- code: "Forbidden" | "Unauthorized";
208
- message: "Agent is not authenticated" | "Insufficient agent scopes";
209
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
369
+ readonly protectPermission: {
370
+ <AuthReturn, AuthFailReturn_6 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
371
+ readonly code: "Bad Request";
372
+ readonly message: "Cookies are missing";
373
+ } | {
374
+ readonly code: "Forbidden";
375
+ readonly message: "Insufficient permissions";
376
+ } | {
377
+ readonly code: "Unauthorized";
378
+ readonly message: "User is not authenticated";
379
+ }) => AuthFailReturn_6) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_6>>;
380
+ <AuthReturn, AuthFailReturn_7 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
381
+ readonly code: "Bad Request";
382
+ readonly message: "Cookies are missing";
383
+ } | {
384
+ readonly code: "Forbidden";
385
+ readonly message: "Insufficient permissions";
386
+ } | {
387
+ readonly code: "Unauthorized";
388
+ readonly message: "User is not authenticated";
389
+ }) => AuthFailReturn_7) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_7>>;
390
+ };
391
+ } & {
392
+ readonly protectAgent: {
393
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
394
+ code: "Forbidden" | "Unauthorized";
395
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
396
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
397
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
398
+ code: "Forbidden" | "Unauthorized";
399
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
400
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
401
+ };
210
402
  });
211
403
  }, {
212
404
  typebox: {};
@@ -230,14 +422,22 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
230
422
  macroFn: {};
231
423
  parser: {};
232
424
  response: import("elysia/types").ExtractErrorFromHandle<{
233
- readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
234
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
235
- readonly code: "Bad Request";
236
- readonly message: "Cookies are missing";
237
- } | {
238
- readonly code: "Unauthorized";
239
- readonly message: "User is not authenticated";
240
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
425
+ readonly protectRoute: {
426
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
427
+ readonly code: "Bad Request";
428
+ readonly message: "Cookies are missing";
429
+ } | {
430
+ readonly code: "Unauthorized";
431
+ readonly message: "User is not authenticated";
432
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
433
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
434
+ readonly code: "Bad Request";
435
+ readonly message: "Cookies are missing";
436
+ } | {
437
+ readonly code: "Unauthorized";
438
+ readonly message: "User is not authenticated";
439
+ }) => 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>>;
440
+ };
241
441
  }>;
242
442
  } & ({
243
443
  schema: {};
@@ -251,10 +451,16 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
251
451
  macroFn: {};
252
452
  parser: {};
253
453
  response: import("elysia/types").ExtractErrorFromHandle<{
254
- readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
255
- readonly code: "Unauthorized";
256
- readonly message: "Recent authentication required";
257
- }) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
454
+ readonly requireRecentAuth: {
455
+ <AuthReturn, AuthFailReturn_2 = never>(maxAgeMs: number, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
456
+ readonly code: "Unauthorized";
457
+ readonly message: "Recent authentication required";
458
+ }) => AuthFailReturn_2) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_2>>;
459
+ <AuthReturn, AuthFailReturn_3 = never>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
460
+ readonly code: "Unauthorized";
461
+ readonly message: "Recent authentication required";
462
+ }) => AuthFailReturn_3) | undefined): Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | Awaited<AuthFailReturn_3>>;
463
+ };
258
464
  }>;
259
465
  } & (import("elysia/types").DefaultMetadata | {
260
466
  schema: {};
@@ -268,16 +474,28 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
268
474
  macroFn: {};
269
475
  parser: {};
270
476
  response: import("elysia/types").ExtractErrorFromHandle<{
271
- readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
272
- readonly code: "Bad Request";
273
- readonly message: "Cookies are missing";
274
- } | {
275
- readonly code: "Forbidden";
276
- readonly message: "Insufficient permissions";
277
- } | {
278
- readonly code: "Unauthorized";
279
- readonly message: "User is not authenticated";
280
- }) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
477
+ readonly protectPermission: {
478
+ <AuthReturn, AuthFailReturn_6 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => Promise<AuthReturn>, handleAuthFail?: ((error: {
479
+ readonly code: "Bad Request";
480
+ readonly message: "Cookies are missing";
481
+ } | {
482
+ readonly code: "Forbidden";
483
+ readonly message: "Insufficient permissions";
484
+ } | {
485
+ readonly code: "Unauthorized";
486
+ readonly message: "User is not authenticated";
487
+ }) => AuthFailReturn_6) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_6>>;
488
+ <AuthReturn, AuthFailReturn_7 = never>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn, handleAuthFail?: ((error: {
489
+ readonly code: "Bad Request";
490
+ readonly message: "Cookies are missing";
491
+ } | {
492
+ readonly code: "Forbidden";
493
+ readonly message: "Insufficient permissions";
494
+ } | {
495
+ readonly code: "Unauthorized";
496
+ readonly message: "User is not authenticated";
497
+ }) => AuthFailReturn_7) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn_7>>;
498
+ };
281
499
  }>;
282
500
  }))))) & {
283
501
  schema: {};
@@ -286,10 +504,16 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
286
504
  macroFn: {};
287
505
  parser: {};
288
506
  response: import("elysia/types").ExtractErrorFromHandle<{
289
- readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
290
- code: "Forbidden" | "Unauthorized";
291
- message: "Agent is not authenticated" | "Insufficient agent scopes";
292
- }) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
507
+ readonly protectAgent: {
508
+ <AuthReturn, AuthFailReturn_4 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => Promise<AuthReturn>, handleAuthFail?: (error: {
509
+ code: "Forbidden" | "Unauthorized";
510
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
511
+ }) => AuthFailReturn_4): Promise<Response | AuthReturn | Awaited<AuthFailReturn_4>>;
512
+ <AuthReturn, AuthFailReturn_5 = never>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn, handleAuthFail?: (error: {
513
+ code: "Forbidden" | "Unauthorized";
514
+ message: "Agent is not authenticated" | "Insufficient agent scopes";
515
+ }) => AuthFailReturn_5): Promise<Response | AuthReturn | Awaited<AuthFailReturn_5>>;
516
+ };
293
517
  }>;
294
518
  }, {}, import("elysia/types").DefaultEphemeral, {
295
519
  derive: {};
@@ -936,16 +1160,38 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
936
1160
  session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<import(".").AuthHtmxUser>;
937
1161
  unregisteredSession: import("./types").UnregisteredSessionRecord;
938
1162
  };
939
- derive: {} | {
940
- readonly authPrincipal: import("./principal").AuthPrincipal<import(".").AuthHtmxUser> | undefined;
941
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: import(".").AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
942
- readonly code: "Bad Request";
943
- readonly message: "Cookies are missing";
1163
+ derive: {} | ({
1164
+ readonly absoluteAuthStatus: {
1165
+ error: {
1166
+ readonly code: "Bad Request";
1167
+ readonly message: "Cookies are missing";
1168
+ };
1169
+ user: null;
1170
+ impersonator?: undefined;
944
1171
  } | {
945
- readonly code: "Unauthorized";
946
- readonly message: "User is not authenticated";
947
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
948
- };
1172
+ error: null;
1173
+ impersonator: import("./types").Impersonator | undefined;
1174
+ user: import(".").AuthHtmxUser | null;
1175
+ };
1176
+ readonly authPrincipal: import("./principal").AuthPrincipal<import(".").AuthHtmxUser> | undefined;
1177
+ } & {
1178
+ readonly protectRoute: {
1179
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: import(".").AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
1180
+ readonly code: "Bad Request";
1181
+ readonly message: "Cookies are missing";
1182
+ } | {
1183
+ readonly code: "Unauthorized";
1184
+ readonly message: "User is not authenticated";
1185
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
1186
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: import(".").AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
1187
+ readonly code: "Bad Request";
1188
+ readonly message: "Cookies are missing";
1189
+ } | {
1190
+ readonly code: "Unauthorized";
1191
+ readonly message: "User is not authenticated";
1192
+ }) => 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>>;
1193
+ };
1194
+ });
949
1195
  }, {
950
1196
  typebox: {};
951
1197
  error: [];
@@ -968,14 +1214,22 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
968
1214
  macroFn: {};
969
1215
  parser: {};
970
1216
  response: import("elysia/types").ExtractErrorFromHandle<{
971
- readonly authPrincipal: import("./principal").AuthPrincipal<import(".").AuthHtmxUser> | undefined;
972
- readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: import(".").AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
973
- readonly code: "Bad Request";
974
- readonly message: "Cookies are missing";
975
- } | {
976
- readonly code: "Unauthorized";
977
- readonly message: "User is not authenticated";
978
- }) => AuthFailReturn) | undefined) => import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | AuthReturn | Promise<AuthReturn> | NonNullable<AuthFailReturn>;
1217
+ readonly protectRoute: {
1218
+ <AuthReturn, AuthFailReturn = never>(handleAuth: (user: import(".").AuthHtmxUser) => Promise<AuthReturn>, handleAuthFail?: ((error: {
1219
+ readonly code: "Bad Request";
1220
+ readonly message: "Cookies are missing";
1221
+ } | {
1222
+ readonly code: "Unauthorized";
1223
+ readonly message: "User is not authenticated";
1224
+ }) => AuthFailReturn) | undefined): Promise<(import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401>) | AuthReturn | Awaited<AuthFailReturn>>;
1225
+ <AuthReturn, AuthFailReturn_1 = never>(handleAuth: (user: import(".").AuthHtmxUser) => AuthReturn, handleAuthFail?: ((error: {
1226
+ readonly code: "Bad Request";
1227
+ readonly message: "Cookies are missing";
1228
+ } | {
1229
+ readonly code: "Unauthorized";
1230
+ readonly message: "User is not authenticated";
1231
+ }) => 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>>;
1232
+ };
979
1233
  }>;
980
1234
  } & {
981
1235
  schema: {};
@@ -3449,7 +3703,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3449
3703
  query: unknown;
3450
3704
  headers: unknown;
3451
3705
  response: {
3452
- 200: {};
3706
+ 400: "Cookies are missing";
3707
+ 401: "User is not authenticated";
3708
+ 200: Response;
3453
3709
  422: {
3454
3710
  type: "validation";
3455
3711
  title: "Validation Error";
@@ -3478,7 +3734,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3478
3734
  query: unknown;
3479
3735
  headers: unknown;
3480
3736
  response: {
3481
- 200: {};
3737
+ 400: "Cookies are missing";
3738
+ 401: "User is not authenticated";
3739
+ 200: Response;
3482
3740
  422: {
3483
3741
  type: "validation";
3484
3742
  title: "Validation Error";
@@ -3508,7 +3766,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3508
3766
  query: unknown;
3509
3767
  headers: unknown;
3510
3768
  response: {
3511
- 200: {};
3769
+ 400: "Cookies are missing";
3770
+ 401: "User is not authenticated";
3771
+ 200: Response;
3512
3772
  422: {
3513
3773
  type: "validation";
3514
3774
  title: "Validation Error";
@@ -3537,7 +3797,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3537
3797
  query: unknown;
3538
3798
  headers: unknown;
3539
3799
  response: {
3540
- 200: {};
3800
+ 400: "Cookies are missing";
3801
+ 401: "User is not authenticated";
3802
+ 200: Response;
3541
3803
  422: {
3542
3804
  type: "validation";
3543
3805
  title: "Validation Error";
@@ -3566,7 +3828,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3566
3828
  query: unknown;
3567
3829
  headers: unknown;
3568
3830
  response: {
3569
- 200: {};
3831
+ 400: "Cookies are missing";
3832
+ 401: "User is not authenticated";
3833
+ 200: Response;
3570
3834
  422: {
3571
3835
  type: "validation";
3572
3836
  title: "Validation Error";
@@ -3623,7 +3887,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3623
3887
  query: unknown;
3624
3888
  headers: unknown;
3625
3889
  response: {
3626
- 200: {};
3890
+ 400: "Cookies are missing";
3891
+ 401: "User is not authenticated";
3892
+ 200: Response;
3627
3893
  422: {
3628
3894
  type: "validation";
3629
3895
  title: "Validation Error";
@@ -3654,7 +3920,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3654
3920
  query: unknown;
3655
3921
  headers: unknown;
3656
3922
  response: {
3657
- 200: {};
3923
+ 400: "Cookies are missing";
3924
+ 401: "User is not authenticated";
3925
+ 200: Response;
3658
3926
  422: {
3659
3927
  type: "validation";
3660
3928
  title: "Validation Error";
@@ -3706,7 +3974,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3706
3974
  query: unknown;
3707
3975
  headers: unknown;
3708
3976
  response: {
3709
- 200: {};
3977
+ 400: "Cookies are missing";
3978
+ 401: "User is not authenticated";
3979
+ 200: Response;
3710
3980
  422: {
3711
3981
  type: "validation";
3712
3982
  title: "Validation Error";