Skip to content

Update password policy in sign-in flow #7435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 17, 2023

Conversation

ch5zzy
Copy link
Contributor

@ch5zzy ch5zzy commented Jul 10, 2023

Update the cached password policy when the sign-in flow (signInWithEmailAndPassword) receives a PASSWORD_DOES_NOT_MEET_REQUIREMENTS error.

@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2023

⚠️ No Changeset found

Latest commit: cf43cbf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 10, 2023

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (1025840)Merge (3453f2d)Diff
    browser176 kB176 kB+98 B (+0.1%)
    cordova204 kB204 kB+77 B (+0.0%)
    esm5229 kB230 kB+77 B (+0.0%)
    main174 kB174 kB+89 B (+0.1%)
    module176 kB176 kB+98 B (+0.1%)
    react-native189 kB189 kB+93 B (+0.0%)
  • @firebase/auth/cordova

    TypeBase (1025840)Merge (3453f2d)Diff
    browser204 kB204 kB+77 B (+0.0%)
    module204 kB204 kB+77 B (+0.0%)
  • @firebase/auth/internal

    TypeBase (1025840)Merge (3453f2d)Diff
    browser186 kB187 kB+98 B (+0.1%)
    esm5243 kB243 kB+77 B (+0.0%)
    main210 kB210 kB+93 B (+0.0%)
    module186 kB187 kB+98 B (+0.1%)
  • @firebase/auth/react-native

    TypeBase (1025840)Merge (3453f2d)Diff
    browser189 kB189 kB+93 B (+0.0%)
    module189 kB189 kB+93 B (+0.0%)
  • bundle

    TypeBase (1025840)Merge (3453f2d)Diff
    auth (EmailAndPassword)79.4 kB79.6 kB+203 B (+0.3%)
  • firebase

    TypeBase (1025840)Merge (3453f2d)Diff
    firebase-auth-compat.js136 kB136 kB+44 B (+0.0%)
    firebase-auth-cordova.js152 kB152 kB+19 B (+0.0%)
    firebase-auth-react-native.js164 kB165 kB+41 B (+0.0%)
    firebase-auth.js130 kB130 kB+46 B (+0.0%)
    firebase-compat.js777 kB777 kB+44 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/JQDb411QH4.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 10, 2023

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • confirmPasswordReset

      Size

      TypeBase (1025840)Merge (3453f2d)Diff
      size38.8 kB38.8 kB-18 B (-0.0%)
      size-with-ext-deps59.6 kB59.5 kB-18 B (-0.0%)
    • createUserWithEmailAndPassword

      Size

      TypeBase (1025840)Merge (3453f2d)Diff
      size40.5 kB40.5 kB-18 B (-0.0%)
      size-with-ext-deps61.3 kB61.2 kB-18 B (-0.0%)
    • signInWithEmailAndPassword

      Size

      TypeBase (1025840)Merge (3453f2d)Diff
      size44.2 kB44.4 kB+203 B (+0.5%)
      size-with-ext-deps65.2 kB65.4 kB+203 B (+0.3%)

      Dependency

      TypeBase (1025840)Merge (3453f2d)Diff
      functions

      68 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailAndPassword
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      69 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      recachePasswordPolicy
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailAndPassword
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      + recachePasswordPolicy

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/kEU4072rvm.html

@ch5zzy ch5zzy requested a review from Xiaoshouzi-gh July 14, 2023 19:27
@ch5zzy ch5zzy marked this pull request as ready for review July 14, 2023 19:37
@ch5zzy ch5zzy requested review from lisajian, prameshj, renkelvin, sam-gc and a team as code owners July 14, 2023 19:37
@ch5zzy ch5zzy merged commit 1532012 into password-policy Jul 17, 2023
@ch5zzy ch5zzy deleted the update-policy-in-sign-in-flow branch July 17, 2023 20:26
ch5zzy added a commit that referenced this pull request Jul 17, 2023
…ot meet the backend requirements (#7435)

* Update signInWithEmailAndPassword to handle updating password policy cache

* Remove await on calls recachePasswordPolicy

* Throw errors instead of rejecting promises
@firebase firebase locked and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants