Skip to content

Fix remember me checkbox not honored when logging in with passkeys#133

Merged
santiagorodriguez96 merged 2 commits intomasterfrom
sr--remember-me-for-passkey-login
Mar 27, 2026
Merged

Fix remember me checkbox not honored when logging in with passkeys#133
santiagorodriguez96 merged 2 commits intomasterfrom
sr--remember-me-for-passkey-login

Conversation

@santiagorodriguez96
Copy link
Copy Markdown
Collaborator

Fixes #132

@santiagorodriguez96
Copy link
Copy Markdown
Collaborator Author

Opening as draft as I still want to add some tests 👀

@santiagorodriguez96 santiagorodriguez96 force-pushed the sr--remember-me-for-passkey-login branch from 7118c6c to 43445ec Compare March 19, 2026 22:13
Comment on lines +47 to +57
def remember_me(resource)
resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)
end

def remember_me?
params_auth_hash.is_a?(Hash) && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me])
end

def params_auth_hash
params[scope]
end
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We should probably think about inheriting from the Authenticatable strategy so that we have all these methods available

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these methods come from Devise?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

end

def remember_me?
params_auth_hash.is_a?(Hash) && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

params_auth_hash uses params, in which cases would params not be a hash?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a good question... to be honest I don't really know 🤔

I will have to dig in a little bit deeper inside Devise 👀

Comment on lines +47 to +57
def remember_me(resource)
resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)
end

def remember_me?
params_auth_hash.is_a?(Hash) && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me])
end

def params_auth_hash
params[scope]
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these methods come from Devise?

@santiagorodriguez96 santiagorodriguez96 marked this pull request as ready for review March 26, 2026 18:31
Copy link
Copy Markdown
Contributor

@RenzoMinelli RenzoMinelli left a comment

Choose a reason for hiding this comment

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

Still think we need to solve the issue of resource scoping on the helper 👀

@santiagorodriguez96
Copy link
Copy Markdown
Collaborator Author

Still think we need to solve the issue of resource scoping on the helper 👀

Will take care of that in a follow up PR 👀

@santiagorodriguez96 santiagorodriguez96 merged commit fe11674 into master Mar 27, 2026
25 checks passed
@santiagorodriguez96 santiagorodriguez96 deleted the sr--remember-me-for-passkey-login branch March 27, 2026 13:48
@RenzoMinelli RenzoMinelli mentioned this pull request Apr 6, 2026
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.

Remember me checkbox not honored when logging in with passkeys

3 participants