@auth-gate/core 0.11.0 → 0.12.0
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/README.md +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +14 -14
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -502,11 +502,11 @@ var AuthGateClient = class {
|
|
|
502
502
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
503
503
|
"Content-Type": "application/json"
|
|
504
504
|
},
|
|
505
|
-
body: JSON.stringify({
|
|
505
|
+
body: JSON.stringify(__spreadValues({
|
|
506
506
|
callback_url: callbackUrl,
|
|
507
507
|
state: options == null ? void 0 : options.state,
|
|
508
508
|
link_to: options == null ? void 0 : options.linkTo
|
|
509
|
-
})
|
|
509
|
+
}, (options == null ? void 0 : options.locale) && { locale: options.locale }))
|
|
510
510
|
}
|
|
511
511
|
);
|
|
512
512
|
if (!response.ok) {
|
|
@@ -534,12 +534,12 @@ var AuthGateClient = class {
|
|
|
534
534
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
535
535
|
"Content-Type": "application/json"
|
|
536
536
|
},
|
|
537
|
-
body: JSON.stringify({
|
|
537
|
+
body: JSON.stringify(__spreadValues({
|
|
538
538
|
email: data.email,
|
|
539
539
|
password: data.password,
|
|
540
540
|
name: data.name,
|
|
541
541
|
callback_url: data.callbackUrl
|
|
542
|
-
})
|
|
542
|
+
}, data.locale && { locale: data.locale }))
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
/**
|
|
@@ -558,11 +558,11 @@ var AuthGateClient = class {
|
|
|
558
558
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
559
559
|
"Content-Type": "application/json"
|
|
560
560
|
},
|
|
561
|
-
body: JSON.stringify({
|
|
561
|
+
body: JSON.stringify(__spreadValues({
|
|
562
562
|
email: data.email,
|
|
563
563
|
password: data.password,
|
|
564
564
|
callback_url: data.callbackUrl
|
|
565
|
-
})
|
|
565
|
+
}, data.locale && { locale: data.locale }))
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
/**
|
|
@@ -578,10 +578,10 @@ var AuthGateClient = class {
|
|
|
578
578
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
579
579
|
"Content-Type": "application/json"
|
|
580
580
|
},
|
|
581
|
-
body: JSON.stringify({
|
|
581
|
+
body: JSON.stringify(__spreadValues({
|
|
582
582
|
email: data.email,
|
|
583
583
|
callback_url: data.callbackUrl
|
|
584
|
-
})
|
|
584
|
+
}, data.locale && { locale: data.locale }))
|
|
585
585
|
});
|
|
586
586
|
}
|
|
587
587
|
/**
|
|
@@ -599,10 +599,10 @@ var AuthGateClient = class {
|
|
|
599
599
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
600
600
|
"Content-Type": "application/json"
|
|
601
601
|
},
|
|
602
|
-
body: JSON.stringify({
|
|
602
|
+
body: JSON.stringify(__spreadValues({
|
|
603
603
|
token: data.token,
|
|
604
604
|
password: data.password
|
|
605
|
-
})
|
|
605
|
+
}, data.locale && { locale: data.locale }))
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
608
|
}
|
|
@@ -622,10 +622,10 @@ var AuthGateClient = class {
|
|
|
622
622
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
623
623
|
"Content-Type": "application/json"
|
|
624
624
|
},
|
|
625
|
-
body: JSON.stringify({
|
|
625
|
+
body: JSON.stringify(__spreadValues({
|
|
626
626
|
email: data.email,
|
|
627
627
|
callback_url: data.callbackUrl
|
|
628
|
-
})
|
|
628
|
+
}, data.locale && { locale: data.locale }))
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
// ---------------------------------------------------------------------------
|
|
@@ -644,10 +644,10 @@ var AuthGateClient = class {
|
|
|
644
644
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
645
645
|
"Content-Type": "application/json"
|
|
646
646
|
},
|
|
647
|
-
body: JSON.stringify({
|
|
647
|
+
body: JSON.stringify(__spreadValues({
|
|
648
648
|
email: data.email,
|
|
649
649
|
code: data.code
|
|
650
|
-
})
|
|
650
|
+
}, data.locale && { locale: data.locale }))
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
653
|
// ---------------------------------------------------------------------------
|
package/dist/index.d.cts
CHANGED
|
@@ -260,6 +260,7 @@ declare class AuthGateClient {
|
|
|
260
260
|
getOAuthUrl(provider: OAuthProvider, callbackUrl: string, options?: {
|
|
261
261
|
state?: string;
|
|
262
262
|
linkTo?: string;
|
|
263
|
+
locale?: string;
|
|
263
264
|
}): Promise<string>;
|
|
264
265
|
/**
|
|
265
266
|
* Register a new user with email and password.
|
|
@@ -272,6 +273,7 @@ declare class AuthGateClient {
|
|
|
272
273
|
password: string;
|
|
273
274
|
name?: string;
|
|
274
275
|
callbackUrl: string;
|
|
276
|
+
locale?: string;
|
|
275
277
|
}): Promise<Response>;
|
|
276
278
|
/**
|
|
277
279
|
* Sign in an existing user with email and password.
|
|
@@ -286,6 +288,7 @@ declare class AuthGateClient {
|
|
|
286
288
|
email: string;
|
|
287
289
|
password: string;
|
|
288
290
|
callbackUrl: string;
|
|
291
|
+
locale?: string;
|
|
289
292
|
}): Promise<Response>;
|
|
290
293
|
/**
|
|
291
294
|
* Send a password reset email to the user.
|
|
@@ -296,6 +299,7 @@ declare class AuthGateClient {
|
|
|
296
299
|
emailForgotPassword(data: {
|
|
297
300
|
email: string;
|
|
298
301
|
callbackUrl: string;
|
|
302
|
+
locale?: string;
|
|
299
303
|
}): Promise<Response>;
|
|
300
304
|
/**
|
|
301
305
|
* Confirm a password reset with the token from the reset email.
|
|
@@ -306,6 +310,7 @@ declare class AuthGateClient {
|
|
|
306
310
|
emailResetPassword(data: {
|
|
307
311
|
token: string;
|
|
308
312
|
password: string;
|
|
313
|
+
locale?: string;
|
|
309
314
|
}): Promise<Response>;
|
|
310
315
|
/**
|
|
311
316
|
* Send a magic link email for passwordless authentication.
|
|
@@ -316,6 +321,7 @@ declare class AuthGateClient {
|
|
|
316
321
|
magicLinkSend(data: {
|
|
317
322
|
email: string;
|
|
318
323
|
callbackUrl: string;
|
|
324
|
+
locale?: string;
|
|
319
325
|
}): Promise<Response>;
|
|
320
326
|
/**
|
|
321
327
|
* Verify an email address using a one-time code.
|
|
@@ -326,6 +332,7 @@ declare class AuthGateClient {
|
|
|
326
332
|
emailVerifyCode(data: {
|
|
327
333
|
email: string;
|
|
328
334
|
code: string;
|
|
335
|
+
locale?: string;
|
|
329
336
|
}): Promise<Response>;
|
|
330
337
|
/**
|
|
331
338
|
* Send an SMS verification code to the user's phone number.
|
package/dist/index.d.ts
CHANGED
|
@@ -260,6 +260,7 @@ declare class AuthGateClient {
|
|
|
260
260
|
getOAuthUrl(provider: OAuthProvider, callbackUrl: string, options?: {
|
|
261
261
|
state?: string;
|
|
262
262
|
linkTo?: string;
|
|
263
|
+
locale?: string;
|
|
263
264
|
}): Promise<string>;
|
|
264
265
|
/**
|
|
265
266
|
* Register a new user with email and password.
|
|
@@ -272,6 +273,7 @@ declare class AuthGateClient {
|
|
|
272
273
|
password: string;
|
|
273
274
|
name?: string;
|
|
274
275
|
callbackUrl: string;
|
|
276
|
+
locale?: string;
|
|
275
277
|
}): Promise<Response>;
|
|
276
278
|
/**
|
|
277
279
|
* Sign in an existing user with email and password.
|
|
@@ -286,6 +288,7 @@ declare class AuthGateClient {
|
|
|
286
288
|
email: string;
|
|
287
289
|
password: string;
|
|
288
290
|
callbackUrl: string;
|
|
291
|
+
locale?: string;
|
|
289
292
|
}): Promise<Response>;
|
|
290
293
|
/**
|
|
291
294
|
* Send a password reset email to the user.
|
|
@@ -296,6 +299,7 @@ declare class AuthGateClient {
|
|
|
296
299
|
emailForgotPassword(data: {
|
|
297
300
|
email: string;
|
|
298
301
|
callbackUrl: string;
|
|
302
|
+
locale?: string;
|
|
299
303
|
}): Promise<Response>;
|
|
300
304
|
/**
|
|
301
305
|
* Confirm a password reset with the token from the reset email.
|
|
@@ -306,6 +310,7 @@ declare class AuthGateClient {
|
|
|
306
310
|
emailResetPassword(data: {
|
|
307
311
|
token: string;
|
|
308
312
|
password: string;
|
|
313
|
+
locale?: string;
|
|
309
314
|
}): Promise<Response>;
|
|
310
315
|
/**
|
|
311
316
|
* Send a magic link email for passwordless authentication.
|
|
@@ -316,6 +321,7 @@ declare class AuthGateClient {
|
|
|
316
321
|
magicLinkSend(data: {
|
|
317
322
|
email: string;
|
|
318
323
|
callbackUrl: string;
|
|
324
|
+
locale?: string;
|
|
319
325
|
}): Promise<Response>;
|
|
320
326
|
/**
|
|
321
327
|
* Verify an email address using a one-time code.
|
|
@@ -326,6 +332,7 @@ declare class AuthGateClient {
|
|
|
326
332
|
emailVerifyCode(data: {
|
|
327
333
|
email: string;
|
|
328
334
|
code: string;
|
|
335
|
+
locale?: string;
|
|
329
336
|
}): Promise<Response>;
|
|
330
337
|
/**
|
|
331
338
|
* Send an SMS verification code to the user's phone number.
|
package/dist/index.mjs
CHANGED
|
@@ -459,11 +459,11 @@ var AuthGateClient = class {
|
|
|
459
459
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
460
460
|
"Content-Type": "application/json"
|
|
461
461
|
},
|
|
462
|
-
body: JSON.stringify({
|
|
462
|
+
body: JSON.stringify(__spreadValues({
|
|
463
463
|
callback_url: callbackUrl,
|
|
464
464
|
state: options == null ? void 0 : options.state,
|
|
465
465
|
link_to: options == null ? void 0 : options.linkTo
|
|
466
|
-
})
|
|
466
|
+
}, (options == null ? void 0 : options.locale) && { locale: options.locale }))
|
|
467
467
|
}
|
|
468
468
|
);
|
|
469
469
|
if (!response.ok) {
|
|
@@ -491,12 +491,12 @@ var AuthGateClient = class {
|
|
|
491
491
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
492
492
|
"Content-Type": "application/json"
|
|
493
493
|
},
|
|
494
|
-
body: JSON.stringify({
|
|
494
|
+
body: JSON.stringify(__spreadValues({
|
|
495
495
|
email: data.email,
|
|
496
496
|
password: data.password,
|
|
497
497
|
name: data.name,
|
|
498
498
|
callback_url: data.callbackUrl
|
|
499
|
-
})
|
|
499
|
+
}, data.locale && { locale: data.locale }))
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
@@ -515,11 +515,11 @@ var AuthGateClient = class {
|
|
|
515
515
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
516
516
|
"Content-Type": "application/json"
|
|
517
517
|
},
|
|
518
|
-
body: JSON.stringify({
|
|
518
|
+
body: JSON.stringify(__spreadValues({
|
|
519
519
|
email: data.email,
|
|
520
520
|
password: data.password,
|
|
521
521
|
callback_url: data.callbackUrl
|
|
522
|
-
})
|
|
522
|
+
}, data.locale && { locale: data.locale }))
|
|
523
523
|
});
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
@@ -535,10 +535,10 @@ var AuthGateClient = class {
|
|
|
535
535
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
536
536
|
"Content-Type": "application/json"
|
|
537
537
|
},
|
|
538
|
-
body: JSON.stringify({
|
|
538
|
+
body: JSON.stringify(__spreadValues({
|
|
539
539
|
email: data.email,
|
|
540
540
|
callback_url: data.callbackUrl
|
|
541
|
-
})
|
|
541
|
+
}, data.locale && { locale: data.locale }))
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
544
|
/**
|
|
@@ -556,10 +556,10 @@ var AuthGateClient = class {
|
|
|
556
556
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
557
557
|
"Content-Type": "application/json"
|
|
558
558
|
},
|
|
559
|
-
body: JSON.stringify({
|
|
559
|
+
body: JSON.stringify(__spreadValues({
|
|
560
560
|
token: data.token,
|
|
561
561
|
password: data.password
|
|
562
|
-
})
|
|
562
|
+
}, data.locale && { locale: data.locale }))
|
|
563
563
|
}
|
|
564
564
|
);
|
|
565
565
|
}
|
|
@@ -579,10 +579,10 @@ var AuthGateClient = class {
|
|
|
579
579
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
580
580
|
"Content-Type": "application/json"
|
|
581
581
|
},
|
|
582
|
-
body: JSON.stringify({
|
|
582
|
+
body: JSON.stringify(__spreadValues({
|
|
583
583
|
email: data.email,
|
|
584
584
|
callback_url: data.callbackUrl
|
|
585
|
-
})
|
|
585
|
+
}, data.locale && { locale: data.locale }))
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
588
|
// ---------------------------------------------------------------------------
|
|
@@ -601,10 +601,10 @@ var AuthGateClient = class {
|
|
|
601
601
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
602
602
|
"Content-Type": "application/json"
|
|
603
603
|
},
|
|
604
|
-
body: JSON.stringify({
|
|
604
|
+
body: JSON.stringify(__spreadValues({
|
|
605
605
|
email: data.email,
|
|
606
606
|
code: data.code
|
|
607
|
-
})
|
|
607
|
+
}, data.locale && { locale: data.locale }))
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
// ---------------------------------------------------------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth-gate/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "Core client library for AuthGate — the OAuth proxy that handles provider configuration, token exchange, and user normalization so you don't have to.",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|