Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Recreate firebase user, no metric #756

Merged
merged 3 commits into from
Oct 6, 2020

Conversation

whaught
Copy link
Contributor

@whaught whaught commented Oct 6, 2020

Proposed Changes

  • When resetting password, ensure that if we have a db.User that we also have a firebase user
  • Move password-reset to server-side for Users/ page

**Note: ** This does send the user back through the email verification flow (which is currently bundled with our password-reset invitation and therefore not seen by most users)

This PR fixes the issue without adding a metric. That will be done as a separate PR. See #685

Release Note

Ensure that password-reset flows also check that the firebase user auth is created if it's missing and we have an entry for the user.

@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Oct 6, 2020
Copy link
Member

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -81,16 +81,9 @@ func (c *Controller) HandleCreate() http.Handler {
}

// Create firebase user first, if this fails we don't want a db.User entry
if created, err := user.CreateFirebaseUser(ctx, c.client); err != nil {
flash.Alert("Failed to create user: %v", err)
if _, err := c.createFirebaseUser(ctx, user); err != nil {
c.renderNew(ctx, w)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should swallow this error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not swallowed. c.createFirebaseUser does the flash now (the flash is the same for the places that use the helper)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i see

@sethvargo
Copy link
Member

/lgtm

@google-oss-robot google-oss-robot merged commit abd9123 into google:main Oct 6, 2020
@whaught whaught deleted the recreate-nometric branch October 6, 2020 19:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants