@turbofy-ai/app-runtime 0.0.6 → 0.0.7

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.
@@ -4,6 +4,15 @@ export interface IAuthResult {
4
4
  /** Signup only: the account was created but needs email confirmation. */
5
5
  needsConfirmation?: boolean;
6
6
  }
7
+ export interface ICurrentUser {
8
+ sub: string;
9
+ email?: string;
10
+ groups?: string[];
11
+ }
12
+ export interface ICurrentUserResult {
13
+ user: ICurrentUser | null;
14
+ error?: string;
15
+ }
7
16
  export declare const login: (email: string, password: string) => Promise<IAuthResult>;
8
17
  export declare const signup: (params: {
9
18
  email: string;
@@ -12,6 +21,15 @@ export declare const signup: (params: {
12
21
  }) => Promise<IAuthResult>;
13
22
  export declare const confirmSignup: (email: string, code: string) => Promise<IAuthResult>;
14
23
  export declare const logout: () => Promise<IAuthResult>;
24
+ /** Read the signed-in Cognito user from the published app's session cookies. */
25
+ export declare const currentUser: () => Promise<ICurrentUserResult>;
26
+ /** React hook that loads the signed-in user once on mount. */
27
+ export declare const useCurrentUser: () => {
28
+ refetch: () => Promise<void>;
29
+ user: ICurrentUser | null;
30
+ isLoading: boolean;
31
+ error: string | null;
32
+ };
15
33
  /**
16
34
  * Restrict post-auth redirects to same-site relative paths, rejecting
17
35
  * protocol-relative URLs (e.g. //attacker.com) which also start with "/".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbofy-ai/app-runtime",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {