Fix remember me checkbox not honored when logging in with passkeys#133
Fix remember me checkbox not honored when logging in with passkeys#133santiagorodriguez96 merged 2 commits intomasterfrom
Conversation
|
Opening as draft as I still want to add some tests 👀 |
7118c6c to
43445ec
Compare
| 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 |
There was a problem hiding this comment.
We should probably think about inheriting from the Authenticatable strategy so that we have all these methods available
There was a problem hiding this comment.
Do these methods come from Devise?
There was a problem hiding this comment.
| end | ||
|
|
||
| def remember_me? | ||
| params_auth_hash.is_a?(Hash) && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me]) |
There was a problem hiding this comment.
params_auth_hash uses params, in which cases would params not be a hash?
There was a problem hiding this comment.
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 👀
| 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 |
There was a problem hiding this comment.
Do these methods come from Devise?
RenzoMinelli
left a comment
There was a problem hiding this comment.
Still think we need to solve the issue of resource scoping on the helper 👀
Will take care of that in a follow up PR 👀 |
Fixes #132