@rebasepro/auth 0.1.2 → 0.2.1
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/LICENSE +21 -6
- package/dist/api.d.ts +10 -8
- package/dist/index.d.ts +1 -5
- package/dist/index.es.js +31 -1217
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +32 -1214
- package/dist/index.umd.js.map +1 -1
- package/dist/types.d.ts +13 -8
- package/package.json +10 -9
- package/src/api.ts +31 -22
- package/src/hooks/useBackendUserManagement.ts +10 -1
- package/src/hooks/useRebaseAuthController.ts +11 -16
- package/src/index.ts +1 -8
- package/src/types.ts +6 -5
- package/dist/components/AdminViews.d.ts +0 -22
- package/dist/components/RebaseAuth.d.ts +0 -6
- package/dist/components/RebaseLoginView.d.ts +0 -73
- package/src/components/AdminViews.tsx +0 -825
- package/src/components/RebaseAuth.tsx +0 -23
- package/src/components/RebaseLoginView.tsx +0 -724
package/LICENSE
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rebase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/api.d.ts
CHANGED
|
@@ -33,11 +33,12 @@ export type GoogleLoginPayload = {
|
|
|
33
33
|
/**
|
|
34
34
|
* Login with Google.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Accepts one of:
|
|
37
|
+
* - `{ idToken }` — ID-token flow (One Tap / Sign In button)
|
|
38
|
+
* - `{ accessToken }` — Access-token flow (popup)
|
|
39
|
+
* - `{ code, redirectUri }` — Authorization code flow (most secure)
|
|
38
40
|
*/
|
|
39
41
|
export declare function googleLogin(payload: GoogleLoginPayload): Promise<AuthResponse>;
|
|
40
|
-
export declare function googleLogin(token: string, tokenType?: "idToken" | "accessToken"): Promise<AuthResponse>;
|
|
41
42
|
/**
|
|
42
43
|
* Login with LinkedIn OAuth code
|
|
43
44
|
*/
|
|
@@ -130,21 +131,22 @@ export interface AuthConfigResponse {
|
|
|
130
131
|
needsSetup: boolean;
|
|
131
132
|
/** Whether new user registration is enabled */
|
|
132
133
|
registrationEnabled: boolean;
|
|
133
|
-
/** Whether Google OAuth is configured */
|
|
134
|
-
googleEnabled: boolean;
|
|
135
|
-
/** Whether LinkedIn OAuth is configured */
|
|
136
|
-
linkedinEnabled: boolean;
|
|
137
134
|
/** Whether email service is configured */
|
|
138
135
|
emailServiceEnabled: boolean;
|
|
139
136
|
/** Complete list of enabled OAuth provider IDs (e.g. ["google", "github", "discord"]) */
|
|
140
|
-
enabledProviders
|
|
137
|
+
enabledProviders: string[];
|
|
141
138
|
}
|
|
142
139
|
/**
|
|
143
140
|
* Fetch auth configuration / status from the backend
|
|
144
141
|
* This is an unauthenticated endpoint used to detect bootstrap mode.
|
|
145
142
|
*
|
|
143
|
+
* Results are cached for the session lifetime.
|
|
146
144
|
* Concurrent calls are deduplicated: only one network request is made
|
|
147
145
|
* and all callers share the same promise.
|
|
148
146
|
*/
|
|
149
147
|
export declare function fetchAuthConfig(): Promise<AuthConfigResponse>;
|
|
148
|
+
/**
|
|
149
|
+
* Clear the cached auth config (e.g. on logout or for testing).
|
|
150
|
+
*/
|
|
151
|
+
export declare function clearAuthConfigCache(): void;
|
|
150
152
|
export { AuthApiError };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,5 @@ export type { RebaseAuthController, RebaseAuthControllerProps, AuthTokens, UserI
|
|
|
10
10
|
export { useRebaseAuthController } from "./hooks/useRebaseAuthController";
|
|
11
11
|
export { useBackendUserManagement } from "./hooks/useBackendUserManagement";
|
|
12
12
|
export type { BackendUserManagementConfig, UserManagement } from "./hooks/useBackendUserManagement";
|
|
13
|
-
export {
|
|
14
|
-
export type { RebaseLoginViewProps } from "./components/RebaseLoginView";
|
|
15
|
-
export { RebaseAuth } from "./components/RebaseAuth";
|
|
16
|
-
export { createUserManagementAdminViews, UsersView, RolesView } from "./components/AdminViews";
|
|
17
|
-
export { setApiUrl, getApiUrl, fetchAuthConfig, AuthApiError } from "./api";
|
|
13
|
+
export { setApiUrl, getApiUrl, fetchAuthConfig, clearAuthConfigCache, AuthApiError } from "./api";
|
|
18
14
|
export type { AuthConfigResponse } from "./api";
|