@stytch/vanilla-js 3.0.0 → 3.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8c587e3: Update B2B Password Reset by Session to stay logged in
8
+ - 70475b5: remove unnecessary organization_id param from passwords.resetBySession in B2B client
9
+ - 5d13cfe: Minor copy change on the B2B Passwords UI component
10
+ - Updated dependencies [70475b5]
11
+ - Updated dependencies [311388d]
12
+ - @stytch/core@1.2.2
13
+
14
+ ## 3.0.1
15
+
16
+ ### Patch Changes
17
+
18
+ - b402097: Bug fix for clearing the local storage state and cookies when a stale session exists while using the SDK across subdomains
19
+
3
20
  ## 3.0.0
4
21
 
5
22
  ### Major Changes
@@ -405,12 +405,11 @@ type B2BPasswordResetByExistingPasswordOptions = SessionDurationOptions & {
405
405
  type B2BPasswordResetByExistingPasswordResponse = B2BAuthenticateResponseWithMFA;
406
406
  type B2BPasswordResetBySessionOptions = {
407
407
  /**
408
- * The id of the Organization under which the Member and password belong
408
+ * The new password for the Member.
409
409
  */
410
- organization_id: string;
411
410
  password: string;
412
411
  };
413
- type B2BPasswordResetBySessionResponse = B2BAuthenticateResponse;
412
+ type B2BPasswordResetBySessionResponse = B2BAuthenticateResponseWithMFA;
414
413
  type B2BPasswordStrengthCheckOptions = {
415
414
  /**
416
415
  * The email associated with the password. Provide this for a more accurate strength check.
@@ -466,7 +465,7 @@ type B2BPasswordStrengthCheckResponse = MemberResponseCommon & {
466
465
  };
467
466
  interface IHeadlessB2BPasswordClient {
468
467
  /**
469
- * The Authenticate method wraps the {@link https://stytch.com/docs/api/password-authenticate Authenticate} Password API endpoint.
468
+ * The Authenticate method wraps the {@link https://stytch.com/docs/b2b/api/passwords-authenticate Authenticate} Password API endpoint.
470
469
  * This endpoint verifies that the Member has a password currently set, and that the entered password is correct.
471
470
  *
472
471
  * There are cases where this endpoint will return a `reset_password` error even if the password entered is correct.
@@ -492,7 +491,7 @@ interface IHeadlessB2BPasswordClient {
492
491
  */
493
492
  authenticate(options: B2BPasswordAuthenticateOptions): Promise<B2BPasswordAuthenticateResponse>;
494
493
  /**
495
- * The resetByEmailStart method wraps the {@link https://stytch.com/docs/api/password-email-reset-start Reset By Email Start} Password API endpoint.
494
+ * The resetByEmailStart method wraps the {@link https://stytch.com/docs/b2b/api/email-reset-start Reset By Email Start} Password API endpoint.
496
495
  * This endpoint initiates a password reset for the email address provided.
497
496
  * This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate.
498
497
  *
@@ -514,7 +513,7 @@ interface IHeadlessB2BPasswordClient {
514
513
  */
515
514
  resetByEmailStart(options: B2BPasswordResetByEmailStartOptions): Promise<B2BPasswordResetByEmailStartResponse>;
516
515
  /**
517
- * The resetByEmail method wraps the {@link https://stytch.com/docs/api/password-email-reset Reset By Email} Password API endpoint.
516
+ * The resetByEmail method wraps the {@link https://stytch.com/docs/b2b/api/email-reset Reset By Email} Password API endpoint.
518
517
  * This endpoint the Member’s password and authenticate them.
519
518
  * This endpoint checks that the magic link token is valid, hasn't expired, or already been used.
520
519
  * The provided password needs to meet our password strength requirements, which can be checked in advance with the {@link IHeadlessB2BPasswordClient#strengthCheck password strength} endpoint.
@@ -542,7 +541,7 @@ interface IHeadlessB2BPasswordClient {
542
541
  */
543
542
  resetByEmail(options: B2BPasswordResetByEmailOptions): Promise<B2BPasswordResetByEmailResponse>;
544
543
  /**
545
- * The strengthCheck method wraps the {@link https://stytch.com/docs/api/password-strength-check Strength Check} Password API endpoint.
544
+ * The strengthCheck method wraps the {@link https://stytch.com/docs/b2b/api/strength-check Strength Check} Password API endpoint.
546
545
  * This endpoint allows you to check whether or not the Member’s provided password is valid,
547
546
  * and to provide feedback to the Member on how to increase the strength of their password.
548
547
  *
@@ -562,7 +561,7 @@ interface IHeadlessB2BPasswordClient {
562
561
  */
563
562
  strengthCheck(options: B2BPasswordStrengthCheckOptions): Promise<B2BPasswordStrengthCheckResponse>;
564
563
  /**
565
- * The resetByExistingPassword method wraps the {@link https://stytch.com/docs/docs/api/password-existing-password-reset Reset By Existing Password} API endpoint.
564
+ * The resetByExistingPassword method wraps the {@link https://stytch.com/docs/b2b/api/existing-reset Reset By Existing Password} API endpoint.
566
565
  * If this method succeeds, the Member will be logged in, granted an active session, and the
567
566
  * {@link https://stytch.com/docs/sdks/javascript-sdk/resources/cookies-and-session-management session cookies} will be minted and stored in the browser.
568
567
  * You can listen for successful login events anywhere in the codebase with the `stytch.session.onChange()` method or `useStytchSession` hook if you are using React.
@@ -584,7 +583,7 @@ interface IHeadlessB2BPasswordClient {
584
583
  */
585
584
  resetByExistingPassword(options: B2BPasswordResetByExistingPasswordOptions): Promise<B2BPasswordResetByExistingPasswordResponse>;
586
585
  /**
587
- * The resetBySession method wraps the {@link https://stytch.com/docs/docs/api/password-session-reset Reset By Session} API endpoint.
586
+ * The resetBySession method wraps the {@link https://stytch.com/docs/b2b/api/session-reset Reset By Session} API endpoint.
588
587
  * If this method succeeds, the Member will be logged in, granted an active session, and the
589
588
  * {@link https://stytch.com/docs/sdks/javascript-sdk/resources/cookies-and-session-management session cookies} will be minted and stored in the browser.
590
589
  * You can listen for successful login events anywhere in the codebase with the `stytch.session.onChange()` method or `useStytchSession` hook if you are using React.
@@ -405,12 +405,11 @@ type B2BPasswordResetByExistingPasswordOptions = SessionDurationOptions & {
405
405
  type B2BPasswordResetByExistingPasswordResponse = B2BAuthenticateResponseWithMFA;
406
406
  type B2BPasswordResetBySessionOptions = {
407
407
  /**
408
- * The id of the Organization under which the Member and password belong
408
+ * The new password for the Member.
409
409
  */
410
- organization_id: string;
411
410
  password: string;
412
411
  };
413
- type B2BPasswordResetBySessionResponse = B2BAuthenticateResponse;
412
+ type B2BPasswordResetBySessionResponse = B2BAuthenticateResponseWithMFA;
414
413
  type B2BPasswordStrengthCheckOptions = {
415
414
  /**
416
415
  * The email associated with the password. Provide this for a more accurate strength check.
@@ -466,7 +465,7 @@ type B2BPasswordStrengthCheckResponse = MemberResponseCommon & {
466
465
  };
467
466
  interface IHeadlessB2BPasswordClient {
468
467
  /**
469
- * The Authenticate method wraps the {@link https://stytch.com/docs/api/password-authenticate Authenticate} Password API endpoint.
468
+ * The Authenticate method wraps the {@link https://stytch.com/docs/b2b/api/passwords-authenticate Authenticate} Password API endpoint.
470
469
  * This endpoint verifies that the Member has a password currently set, and that the entered password is correct.
471
470
  *
472
471
  * There are cases where this endpoint will return a `reset_password` error even if the password entered is correct.
@@ -492,7 +491,7 @@ interface IHeadlessB2BPasswordClient {
492
491
  */
493
492
  authenticate(options: B2BPasswordAuthenticateOptions): Promise<B2BPasswordAuthenticateResponse>;
494
493
  /**
495
- * The resetByEmailStart method wraps the {@link https://stytch.com/docs/api/password-email-reset-start Reset By Email Start} Password API endpoint.
494
+ * The resetByEmailStart method wraps the {@link https://stytch.com/docs/b2b/api/email-reset-start Reset By Email Start} Password API endpoint.
496
495
  * This endpoint initiates a password reset for the email address provided.
497
496
  * This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate.
498
497
  *
@@ -514,7 +513,7 @@ interface IHeadlessB2BPasswordClient {
514
513
  */
515
514
  resetByEmailStart(options: B2BPasswordResetByEmailStartOptions): Promise<B2BPasswordResetByEmailStartResponse>;
516
515
  /**
517
- * The resetByEmail method wraps the {@link https://stytch.com/docs/api/password-email-reset Reset By Email} Password API endpoint.
516
+ * The resetByEmail method wraps the {@link https://stytch.com/docs/b2b/api/email-reset Reset By Email} Password API endpoint.
518
517
  * This endpoint the Member’s password and authenticate them.
519
518
  * This endpoint checks that the magic link token is valid, hasn't expired, or already been used.
520
519
  * The provided password needs to meet our password strength requirements, which can be checked in advance with the {@link IHeadlessB2BPasswordClient#strengthCheck password strength} endpoint.
@@ -542,7 +541,7 @@ interface IHeadlessB2BPasswordClient {
542
541
  */
543
542
  resetByEmail(options: B2BPasswordResetByEmailOptions): Promise<B2BPasswordResetByEmailResponse>;
544
543
  /**
545
- * The strengthCheck method wraps the {@link https://stytch.com/docs/api/password-strength-check Strength Check} Password API endpoint.
544
+ * The strengthCheck method wraps the {@link https://stytch.com/docs/b2b/api/strength-check Strength Check} Password API endpoint.
546
545
  * This endpoint allows you to check whether or not the Member’s provided password is valid,
547
546
  * and to provide feedback to the Member on how to increase the strength of their password.
548
547
  *
@@ -562,7 +561,7 @@ interface IHeadlessB2BPasswordClient {
562
561
  */
563
562
  strengthCheck(options: B2BPasswordStrengthCheckOptions): Promise<B2BPasswordStrengthCheckResponse>;
564
563
  /**
565
- * The resetByExistingPassword method wraps the {@link https://stytch.com/docs/docs/api/password-existing-password-reset Reset By Existing Password} API endpoint.
564
+ * The resetByExistingPassword method wraps the {@link https://stytch.com/docs/b2b/api/existing-reset Reset By Existing Password} API endpoint.
566
565
  * If this method succeeds, the Member will be logged in, granted an active session, and the
567
566
  * {@link https://stytch.com/docs/sdks/javascript-sdk/resources/cookies-and-session-management session cookies} will be minted and stored in the browser.
568
567
  * You can listen for successful login events anywhere in the codebase with the `stytch.session.onChange()` method or `useStytchSession` hook if you are using React.
@@ -584,7 +583,7 @@ interface IHeadlessB2BPasswordClient {
584
583
  */
585
584
  resetByExistingPassword(options: B2BPasswordResetByExistingPasswordOptions): Promise<B2BPasswordResetByExistingPasswordResponse>;
586
585
  /**
587
- * The resetBySession method wraps the {@link https://stytch.com/docs/docs/api/password-session-reset Reset By Session} API endpoint.
586
+ * The resetBySession method wraps the {@link https://stytch.com/docs/b2b/api/session-reset Reset By Session} API endpoint.
588
587
  * If this method succeeds, the Member will be logged in, granted an active session, and the
589
588
  * {@link https://stytch.com/docs/sdks/javascript-sdk/resources/cookies-and-session-management session cookies} will be minted and stored in the browser.
590
589
  * You can listen for successful login events anywhere in the codebase with the `stytch.session.onChange()` method or `useStytchSession` hook if you are using React.