@absolutejs/auth 0.56.10 → 0.56.12
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/authContext.d.ts +3 -3
- package/dist/htmx/configuredRoutes.d.ts +10 -10
- package/dist/htmx/routes.d.ts +10 -10
- package/dist/index.d.ts +16 -16
- package/dist/index.js +3 -2
- package/dist/index.js.map +4 -4
- package/dist/routes/protectRoute.d.ts +2 -2
- package/dist/server.js +3 -2
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ export declare const protectRoutePlugin: <UserType>({ authSessionStore }?: {
|
|
|
16
16
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
17
17
|
};
|
|
18
18
|
derive: {
|
|
19
|
-
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
19
|
+
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
20
20
|
};
|
|
21
21
|
resolve: {};
|
|
22
22
|
}, {
|
|
@@ -33,7 +33,7 @@ export declare const protectRoutePlugin: <UserType>({ authSessionStore }?: {
|
|
|
33
33
|
macroFn: {};
|
|
34
34
|
parser: {};
|
|
35
35
|
response: import("elysia").ExtractErrorFromHandle<{
|
|
36
|
-
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
36
|
+
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
37
37
|
}>;
|
|
38
38
|
}, {}, {
|
|
39
39
|
derive: {};
|
package/dist/server.js
CHANGED
|
@@ -30248,11 +30248,12 @@ var delegateAgentAuthorization = async (agentAuth, context, auditEmit) => {
|
|
|
30248
30248
|
now,
|
|
30249
30249
|
userId: context.userSub
|
|
30250
30250
|
});
|
|
30251
|
+
const grantedScopes2 = context.scopes.filter((scope) => registration2.allowedScopes.includes(scope) && agentAuth.scopes.includes(scope));
|
|
30251
30252
|
await agentAuth.delegationStore.saveDelegation({
|
|
30252
30253
|
agentId: registration2.agentId,
|
|
30253
30254
|
createdAt: existing?.createdAt ?? now,
|
|
30254
30255
|
delegationId: existing?.delegationId ?? `agd_${crypto.randomUUID()}`,
|
|
30255
|
-
scopes:
|
|
30256
|
+
scopes: [...new Set([...existing?.scopes ?? [], ...grantedScopes2])],
|
|
30256
30257
|
status: "active",
|
|
30257
30258
|
updatedAt: now,
|
|
30258
30259
|
userId: context.userSub
|
|
@@ -30586,5 +30587,5 @@ export {
|
|
|
30586
30587
|
auth2 as auth
|
|
30587
30588
|
};
|
|
30588
30589
|
|
|
30589
|
-
//# debugId=
|
|
30590
|
+
//# debugId=DC157A619FC3907564756E2164756E21
|
|
30590
30591
|
//# sourceMappingURL=server.js.map
|