-
Notifications
You must be signed in to change notification settings - Fork 2
enable local login with devise #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f76949a
5fad64f
ecbd574
4f803ef
1e34ce5
03df822
e814e1f
171bc1a
7558a02
3e2ca3c
0f37c43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,6 +96,29 @@ To run natively: | |
| 1. `make start-native` | ||
| 1. Then visit http://localhost:3100 | ||
|
|
||
| ### Enabling Local Login for Development | ||
|
|
||
| For local development (without AWS Cognito credentials), you can use local login via Devise. To enable local login: | ||
|
|
||
| 1. **Set Rails environment to development**: | ||
|
|
||
| ```bash | ||
| RAILS_ENV=development | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 | ||
|
Comment on lines
+112
to
+118
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| 5. **Visit the sign-up page: Go to http://localhost:3100/users/sign_up and register with any email and password.:**: | ||
|
|
||
| #### IDE tips | ||
|
|
||
| <details> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,6 @@ def destroy | |
| private | ||
|
|
||
| def auth_service | ||
| AuthService.new | ||
| AuthServiceFactory.instance.auth_service | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| require "singleton" | ||
|
|
||
| class AuthServiceFactory | ||
| include Singleton | ||
|
|
||
| def initialize | ||
| @auth_service = | ||
| if ENV["AUTH_ADAPTER"] == "mock" | ||
| AuthService.new(Auth::MockAdapter.new) | ||
| else | ||
| AuthService.new(Auth::CognitoAdapter.new) | ||
| end | ||
| end | ||
|
|
||
| attr_reader :auth_service | ||
| end |
There was a problem hiding this comment.
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