codyshepherd / lunar-rocks

A cooperative music generator for the web.
1 stars 0 forks source link

Add AWS Cognito authentication #47

Closed bgins closed 4 years ago

bgins commented 4 years ago

Please add authentication using the AWS Cognito service. This should include:

The sign up process for a new user should be:

A user should have the option to request the confirmation code be sent again in case they do not receive it.

The user should stay logged in until they log out, and they should be automatically logged in on any other tabs that they have open.

When a user logs out, all tokens should be removed from localstorage and they should be logged out of all tabs.

Two other authentication flows should be considered.

A user forgets their password:

A user wishes to change their password from a profile page:

A decision should be made as to whether a user signs in with their username or email. There are some advantages of using an email. The forgot password page may be friendlier if users only need to guess what email they used. In addition, using email as the primary identifier guarantees its uniqueness with Cognito.

bgins commented 4 years ago

Work on this issue was started in 9bff9fe5231ee41dc58e9b2f903f61346b5788fa and 11fe03f8ec3f6f62504b6cdc42309f04f341e293. This should cover the initial sign up and login flows on the client side.

bgins commented 4 years ago

A couple of details to update on this issue:

  1. A user changes account details from a Settings page. (We can reserve the Profile page for publicly displayed information.)
  2. A user can update their email and password.

The second item implies that username is the primary form of identification for a user (not email). As a result, username cannot be changed.

bgins commented 4 years ago

A few more relevant commits that missed the issue citation: 8ad366d849bb87692b13932890748caed848747b, 3f36bd56ebdcc523c45f22fa4aa48a8307027a31, and 2e4458f61b6a8876848ca80be8b1dceacdd964b6.