@absolutejs/auth 0.57.7 → 0.57.9

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.
@@ -1,12 +1,14 @@
1
1
  import { Elysia } from 'elysia';
2
+ import type { AuthSessionStore } from '../session/types';
2
3
  import { ClientProviders, OnProfileError, OnProfileSuccess, RouteString } from '../types';
3
- type ProfileProps = {
4
+ type ProfileProps<UserType> = {
5
+ authSessionStore?: AuthSessionStore<UserType>;
4
6
  clientProviders: ClientProviders;
5
7
  profileRoute?: RouteString;
6
8
  onProfileSuccess: OnProfileSuccess;
7
9
  onProfileError: OnProfileError;
8
10
  };
9
- export declare const profile: <UserType>({ clientProviders, profileRoute, onProfileSuccess, onProfileError }: ProfileProps) => Elysia<"", {
11
+ export declare const profile: <UserType>({ authSessionStore, clientProviders, profileRoute, onProfileSuccess, onProfileError }: ProfileProps<UserType>) => Elysia<"", {
10
12
  decorator: {};
11
13
  store: {
12
14
  session: import("..").SessionRecord<UserType>;
@@ -33,7 +35,8 @@ export declare const profile: <UserType>({ clientProviders, profileRoute, onProf
33
35
  headers: unknown;
34
36
  response: {
35
37
  400: "Cookies are missing" | "Session has no access token to fetch a profile";
36
- 401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "Invalid provider" | "No user session found";
38
+ 401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
39
+ 501: "Provider does not expose a profile endpoint";
37
40
  200: Response;
38
41
  422: {
39
42
  type: "validation";
@@ -35,7 +35,7 @@ export declare const refresh: <UserType>({ authSessionStore, clientProviders, re
35
35
  query: unknown;
36
36
  headers: unknown;
37
37
  response: {
38
- 400: "Cookies are missing" | "Invalid provider" | "No refresh token found";
38
+ 400: "Cookies are missing" | "No refresh token found";
39
39
  401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
40
40
  501: "Provider is not refreshable";
41
41
  200: Response;
@@ -34,7 +34,7 @@ export declare const revoke: <UserType>({ authSessionStore, clientProviders, rev
34
34
  query: unknown;
35
35
  headers: unknown;
36
36
  response: {
37
- 400: "Cookies are missing" | "Invalid provider" | "Session has no access token to revoke";
37
+ 400: "Cookies are missing" | "Session has no access token to revoke";
38
38
  401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
39
39
  501: "Provider does not support revocation";
40
40
  200: Response;