@absolutejs/auth 0.12.0 → 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.
@@ -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 UserFunctionProps = {
20
- authProvider: string;
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: (userProfile: Record<string, unknown>) => UserType | Promise<UserType>;
114
- getUser: (userProfile: Record<string, unknown>) => UserType | null | undefined | Promise<UserType | null | undefined>;
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.12.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.21.1"
36
+ "citra": "0.22.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@absolutejs/absolute": "0.4.0",