-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add authentication via devise #625
base: main
Are you sure you want to change the base?
Conversation
.bundle/config
Outdated
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.
Started to encounter some weird issues with installing mysql gem in this repo. Not sure if this is required anymore?
# Configure the e-mail address which will be shown in Devise::Mailer, | ||
# note that it will be overwritten if you use your own mailer class | ||
# with default "from" parameter. | ||
config.mailer_sender = "[email protected]" |
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.
This will need to be updated to something real (I added a note in the PR description for needing to setup emails in production)
@@ -1,6 +1,9 @@ | |||
# frozen_string_literal: true | |||
|
|||
Rails.application.routes.draw do | |||
root controller: "comfy/cms/content", cms_path: "", action: "show" |
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.
This is for making root_url
and helpers work in comfy mexican sofa. Devise will often use root_url
for various things.
|
||
require "test_helper" | ||
|
||
class AdminTest < ActiveSupport::TestCase |
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.
Not a bad idea to add some tests here and maybe some higher level tests to test the Sign up flows/etc.
We will have to address the failing tests as well in this PR as I have switch away from Basic Auth to Devise and will need to update the failing tests to use the devise sign in test helpers.
This is the first of a few PRs to help replace the basic authentication we have for CMS Admin (more info here #551)
In this PR we added specifically:
Here is a quick overview of what this gave us:
When you first go to
http://localhost:3000/admin
to view the Admin area of the CMS you will get booted to the login screen:You can login via the user we created in the seeds, on this form use the email: "[email protected]" and password: "password" and hit the login button.
You will now be redirected to the Admin CMS dashboard:
That's it. This replaces the Basic auth flow, and we now have personalized Admin accounts in the database which people can log into the Admin CMS.
Some improvements could be:
Fix broken tests, switch from my basic auth helper to devise test helper and update testsFuture work: