Skip to content

OTWO-7708 Removed default setup of remember_token cookie - #1935

Open
bd-vaibhav wants to merge 1 commit into
stagingfrom
OTWO-7708
Open

OTWO-7708 Removed default setup of remember_token cookie#1935
bd-vaibhav wants to merge 1 commit into
stagingfrom
OTWO-7708

Conversation

@bd-vaibhav

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates session handling so “remember me” behavior is driven by an explicit remember_me helper cookie (set from the sign-in checkbox) rather than a default persistent remember_token cookie setup, and adds coverage around that helper cookie.

Changes:

  • Add a cookie_expiration policy to Clearance based on the remember_me helper cookie.
  • Refactor SessionsController#create to delegate result handling and set/clear the remember_me cookie on successful sign-in.
  • Add controller tests validating remember_me cookie behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/controllers/sessions_controller_test.rb Adds tests asserting remember_me cookie is set/cleared based on the checkbox.
config/initializers/clearance.rb Configures Clearance cookie_expiration based on a remember_me helper cookie and introduces a duration constant.
app/controllers/sessions_controller.rb Refactors sign-in flow and sets/deletes the remember_me helper cookie.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/controllers/sessions_controller_test.rb
Comment thread app/controllers/sessions_controller.rb
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.

2 participants