@nauth-toolkit/client 0.1.18 → 0.1.22
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/dist/angular/index.cjs +381 -166
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.mts +331 -127
- package/dist/angular/index.d.ts +331 -127
- package/dist/angular/index.mjs +380 -165
- package/dist/angular/index.mjs.map +1 -1
- package/dist/index.cjs +60 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +65 -72
- package/dist/index.d.ts +65 -72
- package/dist/index.mjs +60 -110
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -85,6 +85,16 @@ interface AuthResponse {
|
|
|
85
85
|
refreshToken?: string;
|
|
86
86
|
accessTokenExpiresAt?: number;
|
|
87
87
|
refreshTokenExpiresAt?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Authentication method used to create the current session.
|
|
90
|
+
*
|
|
91
|
+
* Examples:
|
|
92
|
+
* - `password`
|
|
93
|
+
* - `google`
|
|
94
|
+
* - `apple`
|
|
95
|
+
* - `facebook`
|
|
96
|
+
*/
|
|
97
|
+
authMethod?: string;
|
|
88
98
|
trusted?: boolean;
|
|
89
99
|
deviceToken?: string;
|
|
90
100
|
challengeName?: AuthChallenge;
|
|
@@ -229,6 +239,13 @@ interface AuthUser {
|
|
|
229
239
|
mfaEnabled?: boolean;
|
|
230
240
|
socialProviders?: string[] | null;
|
|
231
241
|
hasPasswordHash: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Authentication method used to create the current session.
|
|
244
|
+
*
|
|
245
|
+
* This is session-scoped (how the user logged in this time), not an account capability.
|
|
246
|
+
* Use `hasPasswordHash` and `socialProviders` to determine what login methods the account supports.
|
|
247
|
+
*/
|
|
248
|
+
sessionAuthMethod?: string | null;
|
|
232
249
|
createdAt?: string | Date;
|
|
233
250
|
updatedAt?: string | Date;
|
|
234
251
|
}
|
|
@@ -284,25 +301,28 @@ interface ConfirmForgotPasswordResponse {
|
|
|
284
301
|
*/
|
|
285
302
|
type SocialProvider = 'google' | 'apple' | 'facebook';
|
|
286
303
|
/**
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Response containing social auth URL.
|
|
295
|
-
*/
|
|
296
|
-
interface SocialAuthUrlResponse {
|
|
297
|
-
url: string;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Social callback parameters.
|
|
304
|
+
* Options for starting a redirect-first social login flow.
|
|
305
|
+
*
|
|
306
|
+
* This is a web-first API:
|
|
307
|
+
* - Browser navigates to backend `/auth/social/:provider/redirect`
|
|
308
|
+
* - Backend completes OAuth, sets cookies (or returns exchange token), and redirects back
|
|
301
309
|
*/
|
|
302
|
-
interface
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
310
|
+
interface SocialLoginOptions {
|
|
311
|
+
/**
|
|
312
|
+
* Frontend route (recommended) or URL to redirect to after the backend callback completes.
|
|
313
|
+
* Default: config.redirects.success || '/'
|
|
314
|
+
*/
|
|
315
|
+
returnTo?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Optional application state to round-trip back to the frontend.
|
|
318
|
+
* Must be treated as non-secret.
|
|
319
|
+
*/
|
|
320
|
+
appState?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Optional flow action.
|
|
323
|
+
* Default: 'login'
|
|
324
|
+
*/
|
|
325
|
+
action?: 'login' | 'link';
|
|
306
326
|
}
|
|
307
327
|
/**
|
|
308
328
|
* Linked social accounts response.
|
|
@@ -407,6 +427,10 @@ interface NAuthStorageAdapter {
|
|
|
407
427
|
* Remove a stored value.
|
|
408
428
|
*/
|
|
409
429
|
removeItem(key: string): Promise<void>;
|
|
430
|
+
/**
|
|
431
|
+
* Clear all stored values.
|
|
432
|
+
*/
|
|
433
|
+
clear(): Promise<void>;
|
|
410
434
|
}
|
|
411
435
|
|
|
412
436
|
/**
|
|
@@ -529,12 +553,12 @@ interface NAuthEndpoints {
|
|
|
529
553
|
mfaPreferred: string;
|
|
530
554
|
mfaBackupCodes: string;
|
|
531
555
|
mfaExemption: string;
|
|
532
|
-
socialAuthUrl: string;
|
|
533
|
-
socialCallback: string;
|
|
534
556
|
socialLinked: string;
|
|
535
557
|
socialLink: string;
|
|
536
558
|
socialUnlink: string;
|
|
537
559
|
socialVerify: string;
|
|
560
|
+
socialRedirectStart: string;
|
|
561
|
+
socialExchange: string;
|
|
538
562
|
trustDevice: string;
|
|
539
563
|
isTrustedDevice: string;
|
|
540
564
|
auditHistory: string;
|
|
@@ -1180,69 +1204,36 @@ declare class NAuthClient {
|
|
|
1180
1204
|
*/
|
|
1181
1205
|
off(event: AuthEventType | '*', listener: AuthEventListener): void;
|
|
1182
1206
|
/**
|
|
1183
|
-
* Start social OAuth flow
|
|
1207
|
+
* Start redirect-first social OAuth flow (web).
|
|
1208
|
+
*
|
|
1209
|
+
* This performs a browser navigation to:
|
|
1210
|
+
* `GET {baseUrl}/social/:provider/redirect?returnTo=...&appState=...`
|
|
1184
1211
|
*
|
|
1185
|
-
*
|
|
1186
|
-
*
|
|
1212
|
+
* The backend:
|
|
1213
|
+
* - generates and stores CSRF state (cluster-safe)
|
|
1214
|
+
* - redirects the user to the provider
|
|
1215
|
+
* - completes OAuth on callback and sets cookies (or issues an exchange token)
|
|
1216
|
+
* - redirects back to `returnTo` with `appState` (and `exchangeToken` for json/hybrid)
|
|
1187
1217
|
*
|
|
1188
1218
|
* @param provider - OAuth provider ('google', 'apple', 'facebook')
|
|
1189
|
-
* @param options - Optional
|
|
1219
|
+
* @param options - Optional redirect options
|
|
1190
1220
|
*
|
|
1191
1221
|
* @example
|
|
1192
1222
|
* ```typescript
|
|
1193
|
-
*
|
|
1194
|
-
* await client.loginWithSocial('google');
|
|
1195
|
-
*
|
|
1196
|
-
* // With custom redirect URI
|
|
1197
|
-
* await client.loginWithSocial('apple', {
|
|
1198
|
-
* redirectUri: 'https://example.com/auth/callback'
|
|
1199
|
-
* });
|
|
1223
|
+
* await client.loginWithSocial('google', { returnTo: '/auth/callback', appState: '12345' });
|
|
1200
1224
|
* ```
|
|
1201
1225
|
*/
|
|
1202
|
-
loginWithSocial(provider: SocialProvider,
|
|
1203
|
-
redirectUri?: string;
|
|
1204
|
-
}): Promise<void>;
|
|
1226
|
+
loginWithSocial(provider: SocialProvider, options?: SocialLoginOptions): Promise<void>;
|
|
1205
1227
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
* Call this on app initialization or in callback route.
|
|
1209
|
-
* Returns null if not an OAuth callback (no provider/code params).
|
|
1210
|
-
*
|
|
1211
|
-
* The SDK validates the state token, completes authentication via backend,
|
|
1212
|
-
* and emits appropriate events.
|
|
1213
|
-
*
|
|
1214
|
-
* @param urlOrParams - Optional URL string or URLSearchParams (auto-detects from window.location if not provided)
|
|
1215
|
-
* @returns AuthResponse if OAuth callback detected, null otherwise
|
|
1228
|
+
* Exchange an `exchangeToken` (from redirect callback URL) into an AuthResponse.
|
|
1216
1229
|
*
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1219
|
-
* // Auto-detect on app init
|
|
1220
|
-
* const response = await client.handleOAuthCallback();
|
|
1221
|
-
* if (response) {
|
|
1222
|
-
* if (response.challengeName) {
|
|
1223
|
-
* router.navigate(['/challenge', response.challengeName]);
|
|
1224
|
-
* } else {
|
|
1225
|
-
* router.navigate(['/']); // Navigate to your app's home route
|
|
1226
|
-
* }
|
|
1227
|
-
* }
|
|
1228
|
-
*
|
|
1229
|
-
* // In callback route
|
|
1230
|
-
* const response = await client.handleOAuthCallback(window.location.search);
|
|
1231
|
-
* ```
|
|
1232
|
-
*/
|
|
1233
|
-
handleOAuthCallback(urlOrParams?: string | URLSearchParams): Promise<AuthResponse | null>;
|
|
1234
|
-
/**
|
|
1235
|
-
* Get social auth URL (low-level API).
|
|
1230
|
+
* Used for `tokenDelivery: 'json'` or hybrid flows where the backend redirects back
|
|
1231
|
+
* with `exchangeToken` instead of setting cookies.
|
|
1236
1232
|
*
|
|
1237
|
-
*
|
|
1238
|
-
|
|
1239
|
-
getSocialAuthUrl(request: SocialAuthUrlRequest): Promise<{
|
|
1240
|
-
url: string;
|
|
1241
|
-
}>;
|
|
1242
|
-
/**
|
|
1243
|
-
* Handle social callback.
|
|
1233
|
+
* @param exchangeToken - One-time exchange token from the callback URL
|
|
1234
|
+
* @returns AuthResponse
|
|
1244
1235
|
*/
|
|
1245
|
-
|
|
1236
|
+
exchangeSocialRedirect(exchangeToken: string): Promise<AuthResponse>;
|
|
1246
1237
|
/**
|
|
1247
1238
|
* Verify native social token (mobile).
|
|
1248
1239
|
*/
|
|
@@ -1548,6 +1539,7 @@ declare class BrowserStorage implements NAuthStorageAdapter {
|
|
|
1548
1539
|
getItem(key: string): Promise<string | null>;
|
|
1549
1540
|
setItem(key: string, value: string): Promise<void>;
|
|
1550
1541
|
removeItem(key: string): Promise<void>;
|
|
1542
|
+
clear(): Promise<void>;
|
|
1551
1543
|
}
|
|
1552
1544
|
|
|
1553
1545
|
/**
|
|
@@ -1558,6 +1550,7 @@ declare class InMemoryStorage implements NAuthStorageAdapter {
|
|
|
1558
1550
|
getItem(key: string): Promise<string | null>;
|
|
1559
1551
|
setItem(key: string, value: string): Promise<void>;
|
|
1560
1552
|
removeItem(key: string): Promise<void>;
|
|
1553
|
+
clear(): Promise<void>;
|
|
1561
1554
|
}
|
|
1562
1555
|
|
|
1563
1556
|
/**
|
|
@@ -1590,4 +1583,4 @@ declare class FetchAdapter implements HttpAdapter {
|
|
|
1590
1583
|
request<T>(config: HttpRequest): Promise<HttpResponse<T>>;
|
|
1591
1584
|
}
|
|
1592
1585
|
|
|
1593
|
-
export { type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResolvedNAuthClientConfig, type SignupRequest, type
|
|
1586
|
+
export { type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResolvedNAuthClientConfig, type SignupRequest, type SocialLoginOptions, type SocialProvider, type SocialVerifyRequest, type TokenDeliveryMode, type TokenResponse, type UpdateProfileRequest, type VerifyEmailResponse, type VerifyPhoneCodeResponse, type VerifyPhoneCollectResponse, defaultEndpoints, getChallengeInstructions, getMFAMethod, getMaskedDestination, isOTPChallenge, requiresPhoneCollection, resolveConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,16 @@ interface AuthResponse {
|
|
|
85
85
|
refreshToken?: string;
|
|
86
86
|
accessTokenExpiresAt?: number;
|
|
87
87
|
refreshTokenExpiresAt?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Authentication method used to create the current session.
|
|
90
|
+
*
|
|
91
|
+
* Examples:
|
|
92
|
+
* - `password`
|
|
93
|
+
* - `google`
|
|
94
|
+
* - `apple`
|
|
95
|
+
* - `facebook`
|
|
96
|
+
*/
|
|
97
|
+
authMethod?: string;
|
|
88
98
|
trusted?: boolean;
|
|
89
99
|
deviceToken?: string;
|
|
90
100
|
challengeName?: AuthChallenge;
|
|
@@ -229,6 +239,13 @@ interface AuthUser {
|
|
|
229
239
|
mfaEnabled?: boolean;
|
|
230
240
|
socialProviders?: string[] | null;
|
|
231
241
|
hasPasswordHash: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Authentication method used to create the current session.
|
|
244
|
+
*
|
|
245
|
+
* This is session-scoped (how the user logged in this time), not an account capability.
|
|
246
|
+
* Use `hasPasswordHash` and `socialProviders` to determine what login methods the account supports.
|
|
247
|
+
*/
|
|
248
|
+
sessionAuthMethod?: string | null;
|
|
232
249
|
createdAt?: string | Date;
|
|
233
250
|
updatedAt?: string | Date;
|
|
234
251
|
}
|
|
@@ -284,25 +301,28 @@ interface ConfirmForgotPasswordResponse {
|
|
|
284
301
|
*/
|
|
285
302
|
type SocialProvider = 'google' | 'apple' | 'facebook';
|
|
286
303
|
/**
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Response containing social auth URL.
|
|
295
|
-
*/
|
|
296
|
-
interface SocialAuthUrlResponse {
|
|
297
|
-
url: string;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Social callback parameters.
|
|
304
|
+
* Options for starting a redirect-first social login flow.
|
|
305
|
+
*
|
|
306
|
+
* This is a web-first API:
|
|
307
|
+
* - Browser navigates to backend `/auth/social/:provider/redirect`
|
|
308
|
+
* - Backend completes OAuth, sets cookies (or returns exchange token), and redirects back
|
|
301
309
|
*/
|
|
302
|
-
interface
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
310
|
+
interface SocialLoginOptions {
|
|
311
|
+
/**
|
|
312
|
+
* Frontend route (recommended) or URL to redirect to after the backend callback completes.
|
|
313
|
+
* Default: config.redirects.success || '/'
|
|
314
|
+
*/
|
|
315
|
+
returnTo?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Optional application state to round-trip back to the frontend.
|
|
318
|
+
* Must be treated as non-secret.
|
|
319
|
+
*/
|
|
320
|
+
appState?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Optional flow action.
|
|
323
|
+
* Default: 'login'
|
|
324
|
+
*/
|
|
325
|
+
action?: 'login' | 'link';
|
|
306
326
|
}
|
|
307
327
|
/**
|
|
308
328
|
* Linked social accounts response.
|
|
@@ -407,6 +427,10 @@ interface NAuthStorageAdapter {
|
|
|
407
427
|
* Remove a stored value.
|
|
408
428
|
*/
|
|
409
429
|
removeItem(key: string): Promise<void>;
|
|
430
|
+
/**
|
|
431
|
+
* Clear all stored values.
|
|
432
|
+
*/
|
|
433
|
+
clear(): Promise<void>;
|
|
410
434
|
}
|
|
411
435
|
|
|
412
436
|
/**
|
|
@@ -529,12 +553,12 @@ interface NAuthEndpoints {
|
|
|
529
553
|
mfaPreferred: string;
|
|
530
554
|
mfaBackupCodes: string;
|
|
531
555
|
mfaExemption: string;
|
|
532
|
-
socialAuthUrl: string;
|
|
533
|
-
socialCallback: string;
|
|
534
556
|
socialLinked: string;
|
|
535
557
|
socialLink: string;
|
|
536
558
|
socialUnlink: string;
|
|
537
559
|
socialVerify: string;
|
|
560
|
+
socialRedirectStart: string;
|
|
561
|
+
socialExchange: string;
|
|
538
562
|
trustDevice: string;
|
|
539
563
|
isTrustedDevice: string;
|
|
540
564
|
auditHistory: string;
|
|
@@ -1180,69 +1204,36 @@ declare class NAuthClient {
|
|
|
1180
1204
|
*/
|
|
1181
1205
|
off(event: AuthEventType | '*', listener: AuthEventListener): void;
|
|
1182
1206
|
/**
|
|
1183
|
-
* Start social OAuth flow
|
|
1207
|
+
* Start redirect-first social OAuth flow (web).
|
|
1208
|
+
*
|
|
1209
|
+
* This performs a browser navigation to:
|
|
1210
|
+
* `GET {baseUrl}/social/:provider/redirect?returnTo=...&appState=...`
|
|
1184
1211
|
*
|
|
1185
|
-
*
|
|
1186
|
-
*
|
|
1212
|
+
* The backend:
|
|
1213
|
+
* - generates and stores CSRF state (cluster-safe)
|
|
1214
|
+
* - redirects the user to the provider
|
|
1215
|
+
* - completes OAuth on callback and sets cookies (or issues an exchange token)
|
|
1216
|
+
* - redirects back to `returnTo` with `appState` (and `exchangeToken` for json/hybrid)
|
|
1187
1217
|
*
|
|
1188
1218
|
* @param provider - OAuth provider ('google', 'apple', 'facebook')
|
|
1189
|
-
* @param options - Optional
|
|
1219
|
+
* @param options - Optional redirect options
|
|
1190
1220
|
*
|
|
1191
1221
|
* @example
|
|
1192
1222
|
* ```typescript
|
|
1193
|
-
*
|
|
1194
|
-
* await client.loginWithSocial('google');
|
|
1195
|
-
*
|
|
1196
|
-
* // With custom redirect URI
|
|
1197
|
-
* await client.loginWithSocial('apple', {
|
|
1198
|
-
* redirectUri: 'https://example.com/auth/callback'
|
|
1199
|
-
* });
|
|
1223
|
+
* await client.loginWithSocial('google', { returnTo: '/auth/callback', appState: '12345' });
|
|
1200
1224
|
* ```
|
|
1201
1225
|
*/
|
|
1202
|
-
loginWithSocial(provider: SocialProvider,
|
|
1203
|
-
redirectUri?: string;
|
|
1204
|
-
}): Promise<void>;
|
|
1226
|
+
loginWithSocial(provider: SocialProvider, options?: SocialLoginOptions): Promise<void>;
|
|
1205
1227
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
* Call this on app initialization or in callback route.
|
|
1209
|
-
* Returns null if not an OAuth callback (no provider/code params).
|
|
1210
|
-
*
|
|
1211
|
-
* The SDK validates the state token, completes authentication via backend,
|
|
1212
|
-
* and emits appropriate events.
|
|
1213
|
-
*
|
|
1214
|
-
* @param urlOrParams - Optional URL string or URLSearchParams (auto-detects from window.location if not provided)
|
|
1215
|
-
* @returns AuthResponse if OAuth callback detected, null otherwise
|
|
1228
|
+
* Exchange an `exchangeToken` (from redirect callback URL) into an AuthResponse.
|
|
1216
1229
|
*
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1219
|
-
* // Auto-detect on app init
|
|
1220
|
-
* const response = await client.handleOAuthCallback();
|
|
1221
|
-
* if (response) {
|
|
1222
|
-
* if (response.challengeName) {
|
|
1223
|
-
* router.navigate(['/challenge', response.challengeName]);
|
|
1224
|
-
* } else {
|
|
1225
|
-
* router.navigate(['/']); // Navigate to your app's home route
|
|
1226
|
-
* }
|
|
1227
|
-
* }
|
|
1228
|
-
*
|
|
1229
|
-
* // In callback route
|
|
1230
|
-
* const response = await client.handleOAuthCallback(window.location.search);
|
|
1231
|
-
* ```
|
|
1232
|
-
*/
|
|
1233
|
-
handleOAuthCallback(urlOrParams?: string | URLSearchParams): Promise<AuthResponse | null>;
|
|
1234
|
-
/**
|
|
1235
|
-
* Get social auth URL (low-level API).
|
|
1230
|
+
* Used for `tokenDelivery: 'json'` or hybrid flows where the backend redirects back
|
|
1231
|
+
* with `exchangeToken` instead of setting cookies.
|
|
1236
1232
|
*
|
|
1237
|
-
*
|
|
1238
|
-
|
|
1239
|
-
getSocialAuthUrl(request: SocialAuthUrlRequest): Promise<{
|
|
1240
|
-
url: string;
|
|
1241
|
-
}>;
|
|
1242
|
-
/**
|
|
1243
|
-
* Handle social callback.
|
|
1233
|
+
* @param exchangeToken - One-time exchange token from the callback URL
|
|
1234
|
+
* @returns AuthResponse
|
|
1244
1235
|
*/
|
|
1245
|
-
|
|
1236
|
+
exchangeSocialRedirect(exchangeToken: string): Promise<AuthResponse>;
|
|
1246
1237
|
/**
|
|
1247
1238
|
* Verify native social token (mobile).
|
|
1248
1239
|
*/
|
|
@@ -1548,6 +1539,7 @@ declare class BrowserStorage implements NAuthStorageAdapter {
|
|
|
1548
1539
|
getItem(key: string): Promise<string | null>;
|
|
1549
1540
|
setItem(key: string, value: string): Promise<void>;
|
|
1550
1541
|
removeItem(key: string): Promise<void>;
|
|
1542
|
+
clear(): Promise<void>;
|
|
1551
1543
|
}
|
|
1552
1544
|
|
|
1553
1545
|
/**
|
|
@@ -1558,6 +1550,7 @@ declare class InMemoryStorage implements NAuthStorageAdapter {
|
|
|
1558
1550
|
getItem(key: string): Promise<string | null>;
|
|
1559
1551
|
setItem(key: string, value: string): Promise<void>;
|
|
1560
1552
|
removeItem(key: string): Promise<void>;
|
|
1553
|
+
clear(): Promise<void>;
|
|
1561
1554
|
}
|
|
1562
1555
|
|
|
1563
1556
|
/**
|
|
@@ -1590,4 +1583,4 @@ declare class FetchAdapter implements HttpAdapter {
|
|
|
1590
1583
|
request<T>(config: HttpRequest): Promise<HttpResponse<T>>;
|
|
1591
1584
|
}
|
|
1592
1585
|
|
|
1593
|
-
export { type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResolvedNAuthClientConfig, type SignupRequest, type
|
|
1586
|
+
export { type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResolvedNAuthClientConfig, type SignupRequest, type SocialLoginOptions, type SocialProvider, type SocialVerifyRequest, type TokenDeliveryMode, type TokenResponse, type UpdateProfileRequest, type VerifyEmailResponse, type VerifyPhoneCodeResponse, type VerifyPhoneCollectResponse, defaultEndpoints, getChallengeInstructions, getMFAMethod, getMaskedDestination, isOTPChallenge, requiresPhoneCollection, resolveConfig };
|