@absolutejs/auth 0.11.3 → 0.13.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/index.js +520 -23
- package/dist/index.js.map +10 -10
- package/dist/src/authorize.d.ts +3 -2
- package/dist/src/callback.d.ts +3 -2
- package/dist/src/profile.d.ts +3 -2
- package/dist/src/refresh.d.ts +3 -2
- package/dist/src/revoke.d.ts +3 -2
- package/dist/src/types.d.ts +4 -8
- package/package.json +2 -2
package/dist/src/authorize.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { AuthorizeRoute, ClientProviders, OnAuthorizeSuccess } from './types';
|
|
2
|
+
import { AuthorizeRoute, ClientProviders, OnAuthorizeError, OnAuthorizeSuccess } from './types';
|
|
3
3
|
type AuthorizeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
authorizeRoute?: AuthorizeRoute;
|
|
6
6
|
onAuthorizeSuccess?: OnAuthorizeSuccess;
|
|
7
|
+
onAuthorizeError?: OnAuthorizeError;
|
|
7
8
|
};
|
|
8
|
-
export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeSuccess }: AuthorizeProps) => Elysia<"", {
|
|
9
|
+
export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeSuccess, onAuthorizeError }: AuthorizeProps) => Elysia<"", {
|
|
9
10
|
decorator: {};
|
|
10
11
|
store: {};
|
|
11
12
|
derive: {};
|
package/dist/src/callback.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { ClientProviders, OnCallbackSuccess, RouteString } from './types';
|
|
2
|
+
import { ClientProviders, OnCallbackError, OnCallbackSuccess, RouteString } from './types';
|
|
3
3
|
type CallbackProps<UserType> = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
callbackRoute?: RouteString;
|
|
6
6
|
onCallbackSuccess?: OnCallbackSuccess<UserType>;
|
|
7
|
+
onCallbackError?: OnCallbackError;
|
|
7
8
|
};
|
|
8
|
-
export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallbackSuccess }: CallbackProps<UserType>) => Elysia<"", {
|
|
9
|
+
export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallbackSuccess, onCallbackError }: CallbackProps<UserType>) => Elysia<"", {
|
|
9
10
|
decorator: {};
|
|
10
11
|
store: {
|
|
11
12
|
session: import("./types").SessionRecord<UserType>;
|
package/dist/src/profile.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { ClientProviders, OnProfileSuccess, RouteString } from './types';
|
|
2
|
+
import { ClientProviders, OnProfileError, OnProfileSuccess, RouteString } from './types';
|
|
3
3
|
type ProfileProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
profileRoute?: RouteString;
|
|
6
6
|
onProfileSuccess?: OnProfileSuccess;
|
|
7
|
+
onProfileError?: OnProfileError;
|
|
7
8
|
};
|
|
8
|
-
export declare const profile: <UserType>({ clientProviders, profileRoute, onProfileSuccess }: ProfileProps) => Elysia<"", {
|
|
9
|
+
export declare const profile: <UserType>({ clientProviders, profileRoute, onProfileSuccess, onProfileError }: ProfileProps) => Elysia<"", {
|
|
9
10
|
decorator: {};
|
|
10
11
|
store: {
|
|
11
12
|
session: import("./types").SessionRecord<UserType>;
|
package/dist/src/refresh.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { ClientProviders, OnRefreshSuccess, RouteString } from './types';
|
|
2
|
+
import { ClientProviders, OnRefreshError, OnRefreshSuccess, RouteString } from './types';
|
|
3
3
|
type RefreshProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
refreshRoute?: RouteString;
|
|
6
6
|
onRefreshSuccess?: OnRefreshSuccess;
|
|
7
|
+
onRefreshError?: OnRefreshError;
|
|
7
8
|
};
|
|
8
|
-
export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefreshSuccess }: RefreshProps) => Elysia<"", {
|
|
9
|
+
export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefreshSuccess, onRefreshError }: RefreshProps) => Elysia<"", {
|
|
9
10
|
decorator: {};
|
|
10
11
|
store: {
|
|
11
12
|
session: import("./types").SessionRecord<UserType>;
|
package/dist/src/revoke.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { ClientProviders, OnRevocationSuccess, RouteString } from './types';
|
|
2
|
+
import { ClientProviders, OnAuthorizeError, OnRevocationSuccess, RouteString } from './types';
|
|
3
3
|
type RevokeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
revokeRoute?: RouteString;
|
|
6
6
|
onRevocationSuccess?: OnRevocationSuccess;
|
|
7
|
+
onRevocationError?: OnAuthorizeError;
|
|
7
8
|
};
|
|
8
|
-
export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevocationSuccess }: RevokeProps) => Elysia<"", {
|
|
9
|
+
export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevocationSuccess, onRevocationError }: RevokeProps) => Elysia<"", {
|
|
9
10
|
decorator: {};
|
|
10
11
|
store: {
|
|
11
12
|
session: import("./types").SessionRecord<UserType>;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -16,12 +16,8 @@ export type OAuth2ConfigurationOptions = {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
export type SessionRecord<UserType> = Record<string, SessionData<UserType> | undefined>;
|
|
19
|
-
export type
|
|
20
|
-
|
|
21
|
-
userProfile: Record<string, unknown>;
|
|
22
|
-
};
|
|
23
|
-
export type CreateUser<UserType> = ({ userProfile, authProvider }: UserFunctionProps) => Promise<UserType>;
|
|
24
|
-
export type GetUser<UserType> = ({ userProfile, authProvider }: UserFunctionProps) => Promise<UserType | null>;
|
|
19
|
+
export type CreateUser<UserType> = (userIdentity: Record<string, unknown>) => UserType | Promise<UserType>;
|
|
20
|
+
export type GetUser<UserType> = (userIdentity: Record<string, unknown>) => UserType | null | undefined | Promise<UserType | null | undefined>;
|
|
25
21
|
export type OnCallbackSuccess<UserType> = ({ authProvider, tokenResponse, providerInstance, session, userSessionId, originUrl }: {
|
|
26
22
|
providerInstance: OAuth2Client<ProviderOption>;
|
|
27
23
|
authProvider: string;
|
|
@@ -110,7 +106,7 @@ export type InsantiateUserSessionProps<UserType> = {
|
|
|
110
106
|
session: SessionRecord<UserType>;
|
|
111
107
|
providerInstance: OAuth2Client<ProviderOption>;
|
|
112
108
|
userSessionId: `${string}-${string}-${string}-${string}-${string}`;
|
|
113
|
-
createUser:
|
|
114
|
-
getUser:
|
|
109
|
+
createUser: CreateUser<UserType>;
|
|
110
|
+
getUser: GetUser<UserType>;
|
|
115
111
|
};
|
|
116
112
|
export {};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.13.0",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"elysia": ">= 1.2.25"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"citra": "0.
|
|
36
|
+
"citra": "0.22.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@absolutejs/absolute": "0.4.0",
|