@rebasepro/auth 0.1.2 → 0.2.3

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 CHANGED
@@ -1,6 +1,21 @@
1
- Source code in this repository is variously licensed under the Business Source
2
- License 1.1 (BSL), Apache version 2.0 and the MIT license. A copy of each
3
- license can be found in each one of the packages under the folder packages
4
- under a file called License. Source code in a given file is licensed under the
5
- BSL and the copyright belongs to Rebase Authors unless otherwise noted at the
6
- beginning of the file.
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
- * Overload 1 (legacy): `googleLogin("token", "idToken" | "accessToken")`
37
- * Overload 2 (code flow): `googleLogin({ code, redirectUri })`
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?: string[];
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 { RebaseLoginView } from "./components/RebaseLoginView";
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";