@frontegg/rest-api 3.0.8 → 3.0.11

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/auth/index.js CHANGED
@@ -52,7 +52,7 @@ export async function generateLoginResponseFromOAuthResponse(oauthResponse) {
52
52
  accessToken: oauthResponse.id_token,
53
53
  refreshToken: oauthResponse.refresh_token
54
54
  }, decodedContent, me, {
55
- expiresIn: decodedContent.exp ? (new Date().getTime() - decodedContent.exp) / 1000 : 300
55
+ expiresIn: decodedContent.exp ? Math.ceil(decodedContent.exp - new Date().getTime() / 1000) : 300
56
56
  });
57
57
 
58
58
  ContextHolder.setUser(user);
@@ -277,12 +277,18 @@ export interface IAllowedToRememberMfaDevice {
277
277
  isAllowedToRemember: boolean;
278
278
  mfaDeviceExpiration: number;
279
279
  }
280
- export interface IPasswordlessPreLogin {
281
- email: string;
280
+ export interface IBasePasswordlessPreLogin {
282
281
  recaptchaToken?: string;
283
282
  type: AuthStrategyEnum;
284
283
  invitationToken?: string;
285
284
  }
285
+ export interface IEmailPasswordlessPreLogin extends IBasePasswordlessPreLogin {
286
+ email: string;
287
+ }
288
+ export interface IUserIDPasswordlessPreLogin extends IBasePasswordlessPreLogin {
289
+ userId: string;
290
+ }
291
+ export declare type IPasswordlessPreLogin = IEmailPasswordlessPreLogin | IUserIDPasswordlessPreLogin;
286
292
  export interface IPasswordlessPostLogin {
287
293
  token: string;
288
294
  recaptchaToken?: string;
@@ -367,10 +373,16 @@ interface WebAuthnLoginResponse {
367
373
  signature: string;
368
374
  userHandle?: string;
369
375
  }
370
- export interface IWebAuthnPreLogin {
371
- email: string;
376
+ export interface IBaseWebAuthnPreLogin {
372
377
  recaptchaToken?: string;
373
378
  }
379
+ export interface IEmailWebAuthnPreLogin extends IBaseWebAuthnPreLogin {
380
+ email: string;
381
+ }
382
+ export interface IUserIDWebAuthnPreLogin extends IBaseWebAuthnPreLogin {
383
+ userId: string;
384
+ }
385
+ export declare type IWebAuthnPreLogin = IEmailWebAuthnPreLogin | IUserIDWebAuthnPreLogin;
374
386
  interface AllowCredentials {
375
387
  type: string;
376
388
  id: string;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.8
1
+ /** @license Frontegg v3.0.11
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -274,7 +274,7 @@ async function generateLoginResponseFromOAuthResponse(oauthResponse) {
274
274
  accessToken: oauthResponse.id_token,
275
275
  refreshToken: oauthResponse.refresh_token
276
276
  }, decodedContent, me, {
277
- expiresIn: decodedContent.exp ? (new Date().getTime() - decodedContent.exp) / 1000 : 300
277
+ expiresIn: decodedContent.exp ? Math.ceil(decodedContent.exp - new Date().getTime() / 1000) : 300
278
278
  });
279
279
 
280
280
  _ContextHolder.ContextHolder.setUser(user);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.8
1
+ /** @license Frontegg v3.0.11
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.8",
3
+ "version": "3.0.11",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {