Simplify session with trust check to only consider user#10290
Merged
Conversation
zachmargolis
approved these changes
Mar 22, 2024
Contributor
Author
|
I had a misunderstanding of the purpose of In practice, this means that DAP is really only rendered on the "Sign In" page. I think this should still be simplified, but I'm inclined to either (a) target the new session page more precisely (e.g. variable assigned from the controller action) or (b) reuse parts of #10292 if we want to generalize this idea of a "public, crawlable page". |
b29fd2f to
083b746
Compare
aduth
commented
Mar 27, 2024
083b746 to
bfb83c7
Compare
changelog: Internal, Session, Simplify session with trust check to only consider user
Just call user_signed_in directly
Previously removed assertions related to this in 5e98ae010
bfb83c7 to
8c9b7bd
Compare
Merged
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 of changes
Replaces
session_with_trust?withuser_signed_in?, removing consideration of current page.Users::SessionController#newcannot be visited if a user is present (source), so the second part of this condition is redundant.This also fixes an issue obfuscated by previous tests where the return value was not always a boolean but could instead return the full user object when present.
It now always returns a boolean.Edit: Removed helper altogether in b2cb5a9.📜 Testing Plan
Verify DAP is loaded only if signed out.
participate_in_dap: trueinconfig/application.yml