Conversation
8dc984b to
1e34ce5
Compare
lorenyu
left a comment
There was a problem hiding this comment.
At a high level, this approach is a full implementation of authentication, using a database to store authentication credentials. It's too complex for what the goal of this ticket is and also has the added problem of creating unused database fields in production environments. A potential approach that might be better would be to implement a MockAuthAdapter that has a hardcoded password or an otherwise simple authentication challenge that is easy to pass (e.g. it always returns true) rather than a full and real authentication implementation.
| app_local_port: 3100 | ||
| app_name: app-rails | ||
| template: app | ||
| template: app No newline at end of file |
There was a problem hiding this comment.
i'm confused why this shows up as a diff, looks the same
| 1. **Set Rails environment to development**: | ||
|
|
||
| ```bash | ||
| RAILS_ENV=development |
There was a problem hiding this comment.
Isn't this already set by default?
|
|
||
| 2. **Enable Devise in development by setting the environment variable:**: | ||
| ```bash | ||
| USE_DEVISE=true |
There was a problem hiding this comment.
Is this needed? When would we ever not want to use devise?
| 3. **Set up the database (run migrations):**: | ||
| ```bash | ||
| rails db:migrate | ||
|
|
||
| 4. **Follow the instructions for starting a container then start it:**: | ||
| ```bash | ||
| make start-container |
There was a problem hiding this comment.
these two instructions seem redundant with instructions for just running the app locally
There was a problem hiding this comment.
The issue with this approach is this migration will also run in other environments including production. It will be confusing to have columns that are not used in any environment except for local development, especially with columns as seemingly important as encrypted passwords
Ticket
Resolves #171
Changes
Adds the ability to create local users and log in locally via devise
Context for reviewers
To unblock local development when developer lacks AWS credentials, it would be helpful to have the ability to log in locally.
Testing
Add
USE_DEVISE=trueto your.envfileTo test: Run the application, then create a user via the UI. It will take you to the screen that claims you will be receiving an email. You will not receive that email, however, if you go back to the main page and attempt to log in using those credentials, it should work.
Preview environment for app
♻️ Environment destroyed ♻️
Preview environment for app-rails
♻️ Environment destroyed ♻️