@hono/auth-js 1.0.16 → 1.0.17
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/CHANGELOG.md +6 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react.d.cts +8 -13
- package/dist/react.d.ts +8 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hono/auth-js
|
|
2
2
|
|
|
3
|
+
## 1.0.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1210](https://github.com/honojs/middleware/pull/1210) [`0758fd0af1f213131d0894299e5bec716d284580`](https://github.com/honojs/middleware/commit/0758fd0af1f213131d0894299e5bec716d284580) Thanks [@BarryThePenguin](https://github.com/BarryThePenguin)! - Add explicit return types
|
|
8
|
+
|
|
3
9
|
## 1.0.16
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.d.cts
CHANGED
|
@@ -25,7 +25,7 @@ interface AuthConfig extends Omit<AuthConfig$1, 'raw'> {
|
|
|
25
25
|
}
|
|
26
26
|
type ConfigHandler = (c: Context) => AuthConfig;
|
|
27
27
|
declare function setEnvDefaults(env: AuthEnv, config: AuthConfig): void;
|
|
28
|
-
declare function reqWithEnvUrl(req: Request, authUrl?: string): Request
|
|
28
|
+
declare function reqWithEnvUrl(req: Request, authUrl?: string): Request;
|
|
29
29
|
declare function getAuthUser(c: Context): Promise<AuthUser | null>;
|
|
30
30
|
declare function verifyAuth(): MiddlewareHandler;
|
|
31
31
|
declare function initAuthConfig(cb: ConfigHandler): MiddlewareHandler;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface AuthConfig extends Omit<AuthConfig$1, 'raw'> {
|
|
|
25
25
|
}
|
|
26
26
|
type ConfigHandler = (c: Context) => AuthConfig;
|
|
27
27
|
declare function setEnvDefaults(env: AuthEnv, config: AuthConfig): void;
|
|
28
|
-
declare function reqWithEnvUrl(req: Request, authUrl?: string): Request
|
|
28
|
+
declare function reqWithEnvUrl(req: Request, authUrl?: string): Request;
|
|
29
29
|
declare function getAuthUser(c: Context): Promise<AuthUser | null>;
|
|
30
30
|
declare function verifyAuth(): MiddlewareHandler;
|
|
31
31
|
declare function initAuthConfig(cb: ConfigHandler): MiddlewareHandler;
|
package/dist/react.d.cts
CHANGED
|
@@ -75,6 +75,10 @@ type WindowProps = {
|
|
|
75
75
|
width: number;
|
|
76
76
|
height: number;
|
|
77
77
|
};
|
|
78
|
+
type AuthState = {
|
|
79
|
+
status: 'loading' | 'success' | 'errored';
|
|
80
|
+
error?: string;
|
|
81
|
+
};
|
|
78
82
|
|
|
79
83
|
declare class AuthConfigManager {
|
|
80
84
|
private static instance;
|
|
@@ -87,15 +91,7 @@ declare class AuthConfigManager {
|
|
|
87
91
|
initializeConfig(hasInitialSession: boolean): void;
|
|
88
92
|
}
|
|
89
93
|
declare const authConfigManager: AuthConfigManager;
|
|
90
|
-
declare const SessionContext: React$1.Context<
|
|
91
|
-
update: UpdateSession;
|
|
92
|
-
data: Session;
|
|
93
|
-
status: "authenticated";
|
|
94
|
-
} | {
|
|
95
|
-
update: UpdateSession;
|
|
96
|
-
data: null;
|
|
97
|
-
status: "unauthenticated" | "loading";
|
|
98
|
-
} | undefined>;
|
|
94
|
+
declare const SessionContext: React$1.Context<SessionContextValue | undefined>;
|
|
99
95
|
declare function getSession(params?: GetSessionParams): Promise<Session | null>;
|
|
100
96
|
declare function getCsrfToken(): Promise<string>;
|
|
101
97
|
declare function SessionProvider(props: SessionProviderProps): React$1.JSX.Element;
|
|
@@ -108,10 +104,9 @@ interface PopupLoginOptions extends Partial<Omit<WindowProps, 'url'>> {
|
|
|
108
104
|
onSuccess?: () => void;
|
|
109
105
|
callbackUrl?: string;
|
|
110
106
|
}
|
|
111
|
-
|
|
112
|
-
status: "loading" | "success" | "errored";
|
|
113
|
-
error?: string;
|
|
107
|
+
interface LoginState extends AuthState {
|
|
114
108
|
popUpSignin: () => Promise<void>;
|
|
115
|
-
}
|
|
109
|
+
}
|
|
110
|
+
declare const useOauthPopupLogin: (provider: Parameters<typeof signIn>[0], options?: PopupLoginOptions) => LoginState;
|
|
116
111
|
|
|
117
112
|
export { SessionContext, SessionProvider, authConfigManager, getCsrfToken, getProviders, getSession, signIn, signOut, useOauthPopupLogin, useSession };
|
package/dist/react.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ type WindowProps = {
|
|
|
75
75
|
width: number;
|
|
76
76
|
height: number;
|
|
77
77
|
};
|
|
78
|
+
type AuthState = {
|
|
79
|
+
status: 'loading' | 'success' | 'errored';
|
|
80
|
+
error?: string;
|
|
81
|
+
};
|
|
78
82
|
|
|
79
83
|
declare class AuthConfigManager {
|
|
80
84
|
private static instance;
|
|
@@ -87,15 +91,7 @@ declare class AuthConfigManager {
|
|
|
87
91
|
initializeConfig(hasInitialSession: boolean): void;
|
|
88
92
|
}
|
|
89
93
|
declare const authConfigManager: AuthConfigManager;
|
|
90
|
-
declare const SessionContext: React$1.Context<
|
|
91
|
-
update: UpdateSession;
|
|
92
|
-
data: Session;
|
|
93
|
-
status: "authenticated";
|
|
94
|
-
} | {
|
|
95
|
-
update: UpdateSession;
|
|
96
|
-
data: null;
|
|
97
|
-
status: "unauthenticated" | "loading";
|
|
98
|
-
} | undefined>;
|
|
94
|
+
declare const SessionContext: React$1.Context<SessionContextValue | undefined>;
|
|
99
95
|
declare function getSession(params?: GetSessionParams): Promise<Session | null>;
|
|
100
96
|
declare function getCsrfToken(): Promise<string>;
|
|
101
97
|
declare function SessionProvider(props: SessionProviderProps): React$1.JSX.Element;
|
|
@@ -108,10 +104,9 @@ interface PopupLoginOptions extends Partial<Omit<WindowProps, 'url'>> {
|
|
|
108
104
|
onSuccess?: () => void;
|
|
109
105
|
callbackUrl?: string;
|
|
110
106
|
}
|
|
111
|
-
|
|
112
|
-
status: "loading" | "success" | "errored";
|
|
113
|
-
error?: string;
|
|
107
|
+
interface LoginState extends AuthState {
|
|
114
108
|
popUpSignin: () => Promise<void>;
|
|
115
|
-
}
|
|
109
|
+
}
|
|
110
|
+
declare const useOauthPopupLogin: (provider: Parameters<typeof signIn>[0], options?: PopupLoginOptions) => LoginState;
|
|
116
111
|
|
|
117
112
|
export { SessionContext, SessionProvider, authConfigManager, getCsrfToken, getProviders, getSession, signIn, signOut, useOauthPopupLogin, useSession };
|