@absolutejs/auth 0.0.3 → 0.2.0
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/example/utils/userUtils.d.ts +17 -0
- package/dist/index.js +172 -172
- package/dist/src/authorize.d.ts +4 -4
- package/dist/src/callback.d.ts +7 -9
- package/dist/src/constants.d.ts +8 -0
- package/dist/src/index.d.ts +18 -15
- package/dist/src/logout.d.ts +3 -4
- package/dist/src/protectRoute.d.ts +2 -2
- package/dist/src/providers.d.ts +1 -6
- package/dist/src/refresh.d.ts +6 -5
- package/dist/src/revoke.d.ts +6 -5
- package/dist/src/sessionStore.d.ts +2 -2
- package/dist/src/status.d.ts +7 -5
- package/dist/src/typeGuards.d.ts +4 -5
- package/dist/src/types.d.ts +22 -20
- package/dist/src/utils.d.ts +15 -0
- package/package.json +9 -5
package/dist/src/authorize.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { ClientProviders } from './types';
|
|
3
3
|
type AuthorizeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
authorizeRoute?: string;
|
|
6
|
-
onAuthorize?:
|
|
6
|
+
onAuthorize?: () => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorize }: AuthorizeProps) => Elysia<"", {
|
|
9
9
|
decorator: {};
|
|
@@ -31,7 +31,7 @@ export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorize
|
|
|
31
31
|
response: {
|
|
32
32
|
200: import("undici-types").Response;
|
|
33
33
|
400: "Provider is required" | "Invalid provider";
|
|
34
|
-
500:
|
|
34
|
+
500: `Failed to authorize: ${string}` | `Unknown error: ${string}`;
|
|
35
35
|
422: {
|
|
36
36
|
type: "validation";
|
|
37
37
|
on: string;
|
package/dist/src/callback.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { ClientProviders, OnCallback } from './types';
|
|
3
3
|
type CallbackProps<UserType> = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
callbackRoute?: string;
|
|
6
|
-
onCallback?:
|
|
7
|
-
getUser?: GetUser<UserType>;
|
|
8
|
-
createUser?: CreateUser<UserType>;
|
|
6
|
+
onCallback?: OnCallback<UserType>;
|
|
9
7
|
};
|
|
10
|
-
export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallback
|
|
8
|
+
export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallback }: CallbackProps<UserType>) => Elysia<"", {
|
|
11
9
|
decorator: {};
|
|
12
10
|
store: {
|
|
13
11
|
session: import("./types").SessionRecord<UserType>;
|
|
@@ -31,9 +29,9 @@ export declare const callback: <UserType>({ clientProviders, callbackRoute, onCa
|
|
|
31
29
|
headers: unknown;
|
|
32
30
|
response: {
|
|
33
31
|
200: import("undici-types").Response;
|
|
34
|
-
400: "Invalid
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
400: "Invalid callback request" | "Invalid state mismatch" | "Code verifier not found and is required";
|
|
33
|
+
401: "Invalid provider" | "No auth provider found";
|
|
34
|
+
500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
|
|
37
35
|
};
|
|
38
36
|
};
|
|
39
37
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SECONDS_IN_A_MINUTE = 60;
|
|
2
|
+
export declare const MILLISECONDS_IN_A_SECOND = 1000;
|
|
3
|
+
export declare const MILLISECONDS_IN_A_MINUTE: number;
|
|
4
|
+
export declare const MINUTES_IN_AN_HOUR = 60;
|
|
5
|
+
export declare const HOURS_IN_A_DAY = 24;
|
|
6
|
+
export declare const MILLISECONDS_IN_A_DAY: number;
|
|
7
|
+
export declare const COOKIE_MINUTES = 30;
|
|
8
|
+
export declare const COOKIE_DURATION: number;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
1
|
import { OAuth2RequestError, ArcticFetchError } from 'arctic';
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import { Elysia } from 'elysia';
|
|
3
|
+
import { AbsoluteAuthProps } from './types';
|
|
4
|
+
export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callbackRoute, logoutRoute, statusRoute, refreshRoute, revokeRoute, onAuthorize, onCallback, onStatus, onRefresh, onLogout, onRevoke }: AbsoluteAuthProps<UserType>) => Elysia<"", {
|
|
5
5
|
decorator: {};
|
|
6
6
|
store: {
|
|
7
|
-
session: import("./types").SessionRecord<UserType>;
|
|
7
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
8
8
|
};
|
|
9
9
|
derive: {};
|
|
10
10
|
resolve: {};
|
|
@@ -28,8 +28,8 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
28
28
|
headers: unknown;
|
|
29
29
|
response: {
|
|
30
30
|
200: Response;
|
|
31
|
-
500: "Internal Server Error";
|
|
32
31
|
401: "No auth provider found";
|
|
32
|
+
500: `Failed to logout: ${string}`;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
};
|
|
@@ -42,9 +42,10 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
42
42
|
query: unknown;
|
|
43
43
|
headers: unknown;
|
|
44
44
|
response: {
|
|
45
|
-
200:
|
|
46
|
-
400: "Invalid provider";
|
|
45
|
+
200: Response;
|
|
47
46
|
401: "No auth provider found" | "No refresh token found";
|
|
47
|
+
501: "Provider does not support revocation";
|
|
48
|
+
500: `Failed to revoke token: ${string}`;
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
};
|
|
@@ -58,7 +59,8 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
58
59
|
headers: unknown;
|
|
59
60
|
response: {
|
|
60
61
|
200: Response;
|
|
61
|
-
|
|
62
|
+
501: "Provider is not refreshable";
|
|
63
|
+
500: `Error: ${string} - ${string}` | `Unknown Error: ${string}`;
|
|
62
64
|
};
|
|
63
65
|
};
|
|
64
66
|
};
|
|
@@ -71,8 +73,9 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
71
73
|
headers: unknown;
|
|
72
74
|
response: {
|
|
73
75
|
200: Response;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
401: "No auth provider found" | "No refresh token found";
|
|
77
|
+
501: "Provider is not refreshable";
|
|
78
|
+
500: `Failed to refresh token: ${string}` | `Faile to refresh token: Unknown error: ${string}`;
|
|
76
79
|
};
|
|
77
80
|
};
|
|
78
81
|
};
|
|
@@ -89,7 +92,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
89
92
|
response: {
|
|
90
93
|
200: import("undici-types").Response;
|
|
91
94
|
400: "Provider is required" | "Invalid provider";
|
|
92
|
-
500:
|
|
95
|
+
500: `Failed to authorize: ${string}` | `Unknown error: ${string}`;
|
|
93
96
|
422: {
|
|
94
97
|
type: "validation";
|
|
95
98
|
on: string;
|
|
@@ -112,15 +115,15 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
|
|
|
112
115
|
headers: unknown;
|
|
113
116
|
response: {
|
|
114
117
|
200: import("undici-types").Response;
|
|
115
|
-
400: "Invalid
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
400: "Invalid callback request" | "Invalid state mismatch" | "Code verifier not found and is required";
|
|
119
|
+
401: "Invalid provider" | "No auth provider found";
|
|
120
|
+
500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
|
|
118
121
|
};
|
|
119
122
|
};
|
|
120
123
|
};
|
|
121
124
|
}, {
|
|
122
125
|
derive: {
|
|
123
|
-
readonly protectRoute: (
|
|
126
|
+
readonly protectRoute: (handleAuth: () => Promise<Response>, handleAuthFail?: () => Promise<Response>) => Promise<Response | import("elysia/error").ElysiaCustomStatusResponse<"Unauthorized", "No session ID found", 401> | import("elysia/error").ElysiaCustomStatusResponse<"Unauthorized", "No session found", 401>>;
|
|
124
127
|
};
|
|
125
128
|
resolve: {};
|
|
126
129
|
schema: import("elysia").MergeSchema<{
|
package/dist/src/logout.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import type { OAuthEventHandler } from './types';
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
3
2
|
type LogoutProps = {
|
|
4
3
|
logoutRoute?: string;
|
|
5
|
-
onLogout?:
|
|
4
|
+
onLogout?: () => void;
|
|
6
5
|
};
|
|
7
6
|
export declare const logout: ({ logoutRoute, onLogout }: LogoutProps) => Elysia<"", {
|
|
8
7
|
decorator: {};
|
|
@@ -26,8 +25,8 @@ export declare const logout: ({ logoutRoute, onLogout }: LogoutProps) => Elysia<
|
|
|
26
25
|
headers: unknown;
|
|
27
26
|
response: {
|
|
28
27
|
200: Response;
|
|
29
|
-
500: "Internal Server Error";
|
|
30
28
|
401: "No auth provider found";
|
|
29
|
+
500: `Failed to logout: ${string}`;
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
2
|
export declare const protectRoute: <UserType>() => Elysia<"", {
|
|
3
3
|
decorator: {};
|
|
4
4
|
store: {
|
|
@@ -16,7 +16,7 @@ export declare const protectRoute: <UserType>() => Elysia<"", {
|
|
|
16
16
|
parser: {};
|
|
17
17
|
}, {}, {
|
|
18
18
|
derive: {
|
|
19
|
-
readonly protectRoute: (
|
|
19
|
+
readonly protectRoute: (handleAuth: () => Promise<Response>, handleAuthFail?: () => Promise<Response>) => Promise<Response | import("elysia/error").ElysiaCustomStatusResponse<"Unauthorized", "No session ID found", 401> | import("elysia/error").ElysiaCustomStatusResponse<"Unauthorized", "No session found", 401>>;
|
|
20
20
|
};
|
|
21
21
|
resolve: {};
|
|
22
22
|
schema: import("elysia").MergeSchema<{}, {}, "">;
|
package/dist/src/providers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AmazonCognito, AniList, Apple, Atlassian, Auth0, Authentik, Bitbucket, Box, Coinbase, Discord, Dribbble, Dropbox, Facebook, Figma, Intuit, GitHub, GitLab, Google, Kakao, KeyCloak, Lichess, Line, Linear, LinkedIn, MicrosoftEntraId, MyAnimeList, Notion, Okta, Osu, Patreon, Reddit, Roblox, Salesforce, Shikimori, Slack, Spotify, Strava, Tiltify, Tumblr, Twitch, Twitter, VK, WorkOS, Yahoo, Yandex, Zoom, FortyTwo } from 'arctic';
|
|
2
|
-
export
|
|
2
|
+
export declare const providers: {
|
|
3
3
|
AmazonCognito: typeof AmazonCognito;
|
|
4
4
|
AniList: typeof AniList;
|
|
5
5
|
Apple: typeof Apple;
|
|
@@ -48,9 +48,4 @@ export type ProvidersMap = {
|
|
|
48
48
|
Yandex: typeof Yandex;
|
|
49
49
|
Zoom: typeof Zoom;
|
|
50
50
|
};
|
|
51
|
-
export declare const providers: ProvidersMap;
|
|
52
51
|
export declare const normalizedProviderKeys: Record<string, string>;
|
|
53
|
-
export declare const userInfoURLs: Record<string, string>;
|
|
54
|
-
export declare const issuerURLs: Record<string, string>;
|
|
55
|
-
export declare const normalizedUserInfoURLKeys: Record<string, string>;
|
|
56
|
-
export declare const normalizedIssuerURLKeys: Record<string, string>;
|
package/dist/src/refresh.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { ClientProviders } from './types';
|
|
3
3
|
type RefreshProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
refreshRoute?: string;
|
|
6
|
-
onRefresh?:
|
|
6
|
+
onRefresh?: () => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const refresh: ({ clientProviders, refreshRoute, onRefresh }: RefreshProps) => Elysia<"", {
|
|
9
9
|
decorator: {};
|
|
@@ -27,8 +27,9 @@ export declare const refresh: ({ clientProviders, refreshRoute, onRefresh }: Ref
|
|
|
27
27
|
headers: unknown;
|
|
28
28
|
response: {
|
|
29
29
|
200: Response;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
401: "No auth provider found" | "No refresh token found";
|
|
31
|
+
501: "Provider is not refreshable";
|
|
32
|
+
500: `Failed to refresh token: ${string}` | `Faile to refresh token: Unknown error: ${string}`;
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
};
|
package/dist/src/revoke.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { ClientProviders } from './types';
|
|
3
3
|
type RevokeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
revokeRoute?: string;
|
|
6
|
-
onRevoke?:
|
|
6
|
+
onRevoke?: () => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const revoke: ({ clientProviders, revokeRoute, onRevoke }: RevokeProps) => Elysia<"", {
|
|
9
9
|
decorator: {};
|
|
@@ -27,9 +27,10 @@ export declare const revoke: ({ clientProviders, revokeRoute, onRevoke }: Revoke
|
|
|
27
27
|
query: unknown;
|
|
28
28
|
headers: unknown;
|
|
29
29
|
response: {
|
|
30
|
-
200:
|
|
31
|
-
400: "Invalid provider";
|
|
30
|
+
200: Response;
|
|
32
31
|
401: "No auth provider found" | "No refresh token found";
|
|
32
|
+
501: "Provider does not support revocation";
|
|
33
|
+
500: `Failed to revoke token: ${string}`;
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
36
|
};
|
package/dist/src/status.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import Elysia from 'elysia';
|
|
2
|
-
import
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { ClientProviders } from './types';
|
|
3
3
|
type StatusProps = {
|
|
4
|
+
clientProviders: ClientProviders;
|
|
4
5
|
statusRoute?: string;
|
|
5
|
-
onStatus?:
|
|
6
|
+
onStatus?: () => void;
|
|
6
7
|
};
|
|
7
|
-
export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps) => Elysia<"", {
|
|
8
|
+
export declare const status: <UserType>({ clientProviders, statusRoute, onStatus }: StatusProps) => Elysia<"", {
|
|
8
9
|
decorator: {};
|
|
9
10
|
store: {
|
|
10
11
|
session: import("./types").SessionRecord<UserType>;
|
|
@@ -28,7 +29,8 @@ export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps)
|
|
|
28
29
|
headers: unknown;
|
|
29
30
|
response: {
|
|
30
31
|
200: Response;
|
|
31
|
-
|
|
32
|
+
501: "Provider is not refreshable";
|
|
33
|
+
500: `Error: ${string} - ${string}` | `Unknown Error: ${string}`;
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
};
|
package/dist/src/typeGuards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OAuth2Tokens } from 'arctic';
|
|
2
|
-
import { providers
|
|
3
|
-
import
|
|
2
|
+
import { providers } from './providers';
|
|
3
|
+
import { Providers } from './types';
|
|
4
4
|
export declare const isRefreshableProvider: (provider: InstanceType<(typeof providers)[Providers]>) => provider is InstanceType<(typeof providers)[Providers]> & {
|
|
5
5
|
refreshAccessToken: () => Promise<OAuth2Tokens>;
|
|
6
6
|
};
|
|
@@ -8,6 +8,5 @@ export declare const isRevocableProvider: (provider: InstanceType<(typeof provid
|
|
|
8
8
|
revokeAccessToken: (token: string) => Promise<void>;
|
|
9
9
|
};
|
|
10
10
|
export declare const isValidProviderKey: (provider: string) => provider is keyof typeof providers;
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const isValidUser: <UserType>(user: any) => user is UserType;
|
|
11
|
+
export declare const isValidUser: <UserType>(user: unknown) => user is UserType;
|
|
12
|
+
export declare const isNonEmptyString: (str: string | null | undefined) => str is string;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
+
import { Cookie } from 'elysia';
|
|
1
2
|
import { providers } from './providers';
|
|
2
|
-
|
|
3
|
-
export type SessionData<UserType> = {
|
|
3
|
+
type SessionData<UserType> = {
|
|
4
4
|
user: UserType;
|
|
5
5
|
expiresAt: number;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
export type Oauth2ConfigOptions = {
|
|
7
|
+
type Oauth2ConfigOptions = {
|
|
9
8
|
[K in Providers]?: {
|
|
10
9
|
credentials: ConstructorParameters<(typeof providers)[K]>;
|
|
11
10
|
scopes?: string[];
|
|
12
11
|
searchParams?: [string, string][];
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
14
|
+
export type Providers = keyof typeof providers;
|
|
15
|
+
export type SessionRecord<UserType> = Record<string, SessionData<UserType> | undefined>;
|
|
16
|
+
export type UserFunctionProps = {
|
|
17
|
+
authProvider: string;
|
|
17
18
|
decodedIdToken: {
|
|
18
19
|
[key: string]: string | undefined;
|
|
19
20
|
};
|
|
21
|
+
};
|
|
22
|
+
export type CreateUser<UserType> = ({ decodedIdToken, authProvider }: UserFunctionProps) => Promise<UserType>;
|
|
23
|
+
export type GetUser<UserType> = ({ decodedIdToken, authProvider }: UserFunctionProps) => Promise<UserType | null>;
|
|
24
|
+
export type OnCallback<UserType> = ({ authProvider, decodedIdToken, session, user_session_id }: {
|
|
20
25
|
authProvider: string;
|
|
21
|
-
}) => Promise<UserType>;
|
|
22
|
-
export type GetUser<UserType> = ({ decodedIdToken, authProvider }: {
|
|
23
26
|
decodedIdToken: {
|
|
24
27
|
[key: string]: string | undefined;
|
|
25
28
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
session: SessionRecord<UserType>;
|
|
30
|
+
user_session_id: Cookie<string | undefined>;
|
|
31
|
+
}) => void;
|
|
32
|
+
export type AbsoluteAuthProps<UserType> = {
|
|
29
33
|
config: Oauth2ConfigOptions;
|
|
30
34
|
authorizeRoute?: string;
|
|
31
35
|
callbackRoute?: string;
|
|
@@ -33,18 +37,16 @@ export type AbsoluteAuthProps = {
|
|
|
33
37
|
revokeRoute?: string;
|
|
34
38
|
logoutRoute?: string;
|
|
35
39
|
statusRoute?: string;
|
|
36
|
-
onAuthorize?:
|
|
37
|
-
onCallback?:
|
|
38
|
-
onStatus?:
|
|
39
|
-
onRefresh?:
|
|
40
|
-
onLogout?:
|
|
41
|
-
onRevoke?:
|
|
42
|
-
createUser?: CreateUser<any>;
|
|
43
|
-
getUser?: GetUser<any>;
|
|
40
|
+
onAuthorize?: () => void;
|
|
41
|
+
onCallback?: OnCallback<UserType>;
|
|
42
|
+
onStatus?: () => void;
|
|
43
|
+
onRefresh?: () => void;
|
|
44
|
+
onLogout?: () => void;
|
|
45
|
+
onRevoke?: () => void;
|
|
44
46
|
};
|
|
45
47
|
export type ClientProviders = Record<string, {
|
|
46
48
|
providerInstance: InstanceType<(typeof providers)[Providers]>;
|
|
47
49
|
scopes: string[];
|
|
48
50
|
searchParams: [string, string][];
|
|
49
|
-
userInfoURL?: string;
|
|
50
51
|
}>;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Cookie } from 'elysia';
|
|
2
|
+
import { AbsoluteAuthProps, CreateUser, GetUser, SessionRecord } from './types';
|
|
3
|
+
type InsantiateUserSessionProps<UserType> = {
|
|
4
|
+
authProvider: string;
|
|
5
|
+
decodedIdToken: {
|
|
6
|
+
[key: string]: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
session: SessionRecord<UserType>;
|
|
9
|
+
user_session_id: Cookie<string | undefined>;
|
|
10
|
+
createUser?: CreateUser<UserType>;
|
|
11
|
+
getUser?: GetUser<UserType>;
|
|
12
|
+
};
|
|
13
|
+
export declare const instantiateUserSession: <UserType>({ authProvider, decodedIdToken, user_session_id, session, getUser, createUser }: InsantiateUserSessionProps<UserType>) => Promise<void>;
|
|
14
|
+
export declare const createAuthConfig: <UserType>(props: AbsoluteAuthProps<UserType>) => AbsoluteAuthProps<UserType>;
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0
|
|
2
|
+
"version": "0.2.0",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/
|
|
7
|
+
"url": "https://github.com/absolutejs/absolute-auth.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"license": "CC BY-NC 4.0",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"dev": "bun run --watch example/server.ts",
|
|
17
17
|
"db:generate": "drizzle-kit generate --schema ./example/db/schema.ts --dialect postgresql",
|
|
18
18
|
"db:migrate": "bun run ./example/db/migrate.ts",
|
|
19
|
-
"db:studio": "drizzle-kit studio"
|
|
19
|
+
"db:studio": "drizzle-kit studio",
|
|
20
|
+
"release": "bun run format && bun run build && bun publish"
|
|
20
21
|
},
|
|
21
22
|
"keywords": [
|
|
22
23
|
"authorization",
|
|
@@ -27,8 +28,10 @@
|
|
|
27
28
|
],
|
|
28
29
|
"types": "dist/src/index.d.ts",
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"arctic": "3.6.0"
|
|
31
|
-
|
|
31
|
+
"arctic": "3.6.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"elysia": ">= 1.2.0"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@elysiajs/static": "1.2.0",
|
|
@@ -41,6 +44,7 @@
|
|
|
41
44
|
"prettier": "3.5.3",
|
|
42
45
|
"react": "19.1.0",
|
|
43
46
|
"react-dom": "19.1.0",
|
|
47
|
+
"elysia": "1.2.25",
|
|
44
48
|
"typescript": "5.8.3"
|
|
45
49
|
},
|
|
46
50
|
"module": "dist/index.js",
|