@absolutejs/auth 0.77.0 → 0.77.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/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 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";
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
- 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
+ error: null;
21
+ impersonator: import("./types").Impersonator | undefined;
22
+ user: NonNullable<UserType> | null;
23
+ };
24
+ readonly authPrincipal: import("./principal").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
- 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>>;
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
+ };
25
53
  } & {
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>>>;
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
  }) | ({
31
- 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";
65
+ readonly absoluteAuthStatus: {
66
+ error: {
67
+ readonly code: "Bad Request";
68
+ readonly message: "Cookies are missing";
69
+ };
70
+ user: null;
71
+ impersonator?: undefined;
35
72
  } | {
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>;
73
+ error: null;
74
+ impersonator: import("./types").Impersonator | undefined;
75
+ user: NonNullable<UserType> | null;
76
+ };
77
+ readonly authPrincipal: import("./principal").AuthPrincipal<UserType> | undefined;
39
78
  } & {
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>>;
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
+ };
44
95
  } & {
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>>;
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
+ };
55
106
  } & {
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>>>;
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: {};
@@ -3525,7 +3779,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3525
3779
  query: unknown;
3526
3780
  headers: unknown;
3527
3781
  response: {
3528
- 200: {};
3782
+ 400: "Cookies are missing";
3783
+ 401: "User is not authenticated";
3784
+ 200: Response;
3529
3785
  422: {
3530
3786
  type: "validation";
3531
3787
  title: "Validation Error";
@@ -3554,7 +3810,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3554
3810
  query: unknown;
3555
3811
  headers: unknown;
3556
3812
  response: {
3557
- 200: {};
3813
+ 400: "Cookies are missing";
3814
+ 401: "User is not authenticated";
3815
+ 200: Response;
3558
3816
  422: {
3559
3817
  type: "validation";
3560
3818
  title: "Validation Error";
@@ -3584,7 +3842,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3584
3842
  query: unknown;
3585
3843
  headers: unknown;
3586
3844
  response: {
3587
- 200: {};
3845
+ 400: "Cookies are missing";
3846
+ 401: "User is not authenticated";
3847
+ 200: Response;
3588
3848
  422: {
3589
3849
  type: "validation";
3590
3850
  title: "Validation Error";
@@ -3613,7 +3873,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3613
3873
  query: unknown;
3614
3874
  headers: unknown;
3615
3875
  response: {
3616
- 200: {};
3876
+ 400: "Cookies are missing";
3877
+ 401: "User is not authenticated";
3878
+ 200: Response;
3617
3879
  422: {
3618
3880
  type: "validation";
3619
3881
  title: "Validation Error";
@@ -3642,7 +3904,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3642
3904
  query: unknown;
3643
3905
  headers: unknown;
3644
3906
  response: {
3645
- 200: {};
3907
+ 400: "Cookies are missing";
3908
+ 401: "User is not authenticated";
3909
+ 200: Response;
3646
3910
  422: {
3647
3911
  type: "validation";
3648
3912
  title: "Validation Error";
@@ -3699,7 +3963,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3699
3963
  query: unknown;
3700
3964
  headers: unknown;
3701
3965
  response: {
3702
- 200: {};
3966
+ 400: "Cookies are missing";
3967
+ 401: "User is not authenticated";
3968
+ 200: Response;
3703
3969
  422: {
3704
3970
  type: "validation";
3705
3971
  title: "Validation Error";
@@ -3730,7 +3996,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3730
3996
  query: unknown;
3731
3997
  headers: unknown;
3732
3998
  response: {
3733
- 200: {};
3999
+ 400: "Cookies are missing";
4000
+ 401: "User is not authenticated";
4001
+ 200: Response;
3734
4002
  422: {
3735
4003
  type: "validation";
3736
4004
  title: "Validation Error";
@@ -3782,7 +4050,9 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
3782
4050
  query: unknown;
3783
4051
  headers: unknown;
3784
4052
  response: {
3785
- 200: {};
4053
+ 400: "Cookies are missing";
4054
+ 401: "User is not authenticated";
4055
+ 200: Response;
3786
4056
  422: {
3787
4057
  type: "validation";
3788
4058
  title: "Validation Error";