Skip to content

Comments

[SSF-145] - Cognito integration account creation#113

Open
dburkhart07 wants to merge 3 commits intomainfrom
ddb/SSF-145-cognito-integration-account-creation
Open

[SSF-145] - Cognito integration account creation#113
dburkhart07 wants to merge 3 commits intomainfrom
ddb/SSF-145-cognito-integration-account-creation

Conversation

@dburkhart07
Copy link

ℹ️ Issue

Closes #145

📝 Description

This PR goes into the process of creating a new user through Cognito. Our existing Auth Service that utilized the Cognito API required a password, so we needed to use a new one that generates a temporary password, and emails it to the new user that we want to create.

When the user enters their temporary password for the first time, amplify stores a challenge that tells us that we need to create a new permanent password. Because of this, we needed to add in a new frontend modal into what we already had. From there, we can get the user cognito client sub, which is what we now store in our database.

The pantry and food manufacturer flow is slightly different, as they have linked users which are already created as they wait for approval after filling out the application. Because of that, we implement a check to see what their role is to determine if we update it in the database, or create a new user.

✔️ Verification

Run the following steps:

  • Tested users receive emails only when their email does not exist
  • Was able to successfully reset my password through the frontend UI
  • Verified pantries and food manufacturers that do not have an account receive an email, but no additional user is created (just sets the cognito client sub)

🏕️ (Optional) Future Work / Notes

Pending testing being written for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant