Improve Devise config initializer #257
Merged
jarednorman merged 3 commits intoJun 6, 2025
Merged
Conversation
benjaminwil
reviewed
May 1, 2025
jarednorman
approved these changes
May 2, 2025
This is to prevent a situation where an email is valid on the User, but invalid on the Order. This ensures that when an email is being copied from the User when an order is being created, there are no validation errors. Co-authored-by: Jared Norman <jared@super.gd>
This is the default configuration Devise uses. What we had previously sets the `Devise.secret_key` to a random value at application boot that is not known across different instances of the same application.
This makes it obvious that this is an ERB template. Co-authored-by: Jared Norman <jared@super.gd>
ffc7890 to
3eadb06
Compare
jarednorman
approved these changes
Jun 6, 2025
adammathys
approved these changes
Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes two issues: solidusio/solidus#3427 and #251
For the first one: we want to use the same email validator for both users and orders, to avoid validation errors when an email is being copied from a user to an order when an order is created.
For the second issue, we want to default the
Devise.secret_keyin the initializer to what Devise recommends: https://github.com/heartcombo/devise/blob/fec67f98f26fcd9a79072e4581b1bd40d0c7fa1d/lib/devise/rails/routes.rb#L498-L506Testing
We tested this by creating a new Solidus app, changing the
solidus_auth_deviseversion to this branch and re-ran the install task and confirmed the Devise config initializer had our new changes.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: