@imtbl/auth 2.10.7-alpha.5 → 2.10.7-alpha.6

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/src/index.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  // Export Auth class (public API)
2
2
  export { Auth } from './Auth';
3
3
 
4
- // Export AuthManager for use by other packages
5
- export { default as AuthManager } from './authManager';
6
-
7
4
  // Export configuration
8
5
  export { AuthConfiguration, type IAuthConfiguration } from './config';
9
6
 
@@ -1,61 +0,0 @@
1
- import { DirectLoginOptions, User, DeviceTokenResponse, UserZkEvm } from './types';
2
- import { IAuthConfiguration } from './config';
3
- import EmbeddedLoginPrompt from './login/embeddedLoginPrompt';
4
- export default class AuthManager {
5
- private userManager;
6
- private deviceCredentialsManager;
7
- private readonly config;
8
- private readonly embeddedLoginPrompt;
9
- private readonly logoutMode;
10
- /**
11
- * Promise that is used to prevent multiple concurrent calls to the refresh token endpoint.
12
- */
13
- private refreshingPromise;
14
- constructor(config: IAuthConfiguration, embeddedLoginPrompt: EmbeddedLoginPrompt);
15
- private static mapOidcUserToDomainModel;
16
- private static mapDeviceTokenResponseToOidcUser;
17
- private buildExtraQueryParams;
18
- getClientId(): Promise<string>;
19
- loginWithRedirect(directLoginOptions?: DirectLoginOptions): Promise<void>;
20
- /**
21
- * login
22
- * @param directLoginOptions If provided, contains login method and marketing consent options
23
- * @param directLoginOptions.directLoginMethod The login method to use (e.g., 'google', 'apple', 'email')
24
- * @param directLoginOptions.marketingConsentStatus Marketing consent status ('opted_in' or 'unsubscribed')
25
- * @param directLoginOptions.email Required when directLoginMethod is 'email'
26
- */
27
- login(directLoginOptions?: DirectLoginOptions): Promise<User>;
28
- getUserOrLogin(): Promise<User>;
29
- private static shouldUseSigninPopupCallback;
30
- loginCallback(): Promise<undefined | User>;
31
- getPKCEAuthorizationUrl(directLoginOptions?: DirectLoginOptions, imPassportTraceId?: string): Promise<string>;
32
- loginWithPKCEFlowCallback(authorizationCode: string, state: string): Promise<User>;
33
- private getPKCEToken;
34
- storeTokens(tokenResponse: DeviceTokenResponse): Promise<User>;
35
- logout(): Promise<void>;
36
- logoutSilentCallback(url: string): Promise<void>;
37
- removeUser(): Promise<void>;
38
- getLogoutUrl(): Promise<string | null>;
39
- forceUserRefreshInBackground(): void;
40
- forceUserRefresh(): Promise<User | null>;
41
- /**
42
- * Refreshes the token and returns the user.
43
- * If the token is already being refreshed, returns the existing promise.
44
- */
45
- private refreshTokenAndUpdatePromise;
46
- /**
47
- *
48
- * @param typeAssertion {(user: User) => boolean} - Optional. If provided, then the User will be checked against
49
- * the typeAssertion. If the user meets the requirements, then it will be typed as T and returned. If the User
50
- * does NOT meet the type assertion, then execution will continue, and we will attempt to obtain a User that does
51
- * meet the type assertion.
52
- *
53
- * This function will attempt to obtain a User in the following order:
54
- * 1. If the User is currently refreshing, wait for the refresh to complete.
55
- * 2. Attempt to obtain a User from storage that has not expired.
56
- * 3. Attempt to refresh the User if a refresh token is present.
57
- * 4. Return null if no valid User can be obtained.
58
- */
59
- getUser<T extends User>(typeAssertion?: (user: User) => user is T): Promise<T | null>;
60
- getUserZkEvm(): Promise<UserZkEvm>;
61
- }