Skip to content

enable local login with devise#172

Closed
LeslieJAnderson wants to merge 11 commits intomainfrom
enable-local-login-with-devise
Closed

enable local login with devise#172
LeslieJAnderson wants to merge 11 commits intomainfrom
enable-local-login-with-devise

Conversation

@LeslieJAnderson
Copy link
Copy Markdown

@LeslieJAnderson LeslieJAnderson commented Feb 5, 2025

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=true to your .env file

To 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 ♻️

@LeslieJAnderson LeslieJAnderson force-pushed the enable-local-login-with-devise branch from 8dc984b to 1e34ce5 Compare April 14, 2025 19:44
@LeslieJAnderson LeslieJAnderson changed the title enable local local with devise enable local login with devise Apr 23, 2025
@LeslieJAnderson LeslieJAnderson marked this pull request as ready for review April 23, 2025 19:37
Copy link
Copy Markdown
Collaborator

@lorenyu lorenyu left a comment

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i'm confused why this shows up as a diff, looks the same

1. **Set Rails environment to development**:

```bash
RAILS_ENV=development
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Isn't this already set by default?


2. **Enable Devise in development by setting the environment variable:**:
```bash
USE_DEVISE=true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this needed? When would we ever not want to use devise?

Comment on lines +112 to +118
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these two instructions seem redundant with instructions for just running the app locally

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

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.

Enable local login via devise

3 participants