-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix login remember me with google authentication #740
base: master
Are you sure you want to change the base?
fix login remember me with google authentication #740
Conversation
src/Controller/Traits/LoginTrait.php
Outdated
// for after login event auth | ||
$hasRememberMe = $this->request->getSession()->read('hasRememberMe'); | ||
if ($hasRememberMe) { | ||
$this->request->data(Configure::read('Users.RememberMe.Cookie.name'), $hasRememberMe); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test for this
@@ -288,6 +288,14 @@ public function verify() | |||
|
|||
$user['secret_verified'] = true; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix code style issues https://travis-ci.org/CakeDC/users/jobs/467177140
src/Controller/Traits/LoginTrait.php
Outdated
|
||
// Push the remember me value to post data | ||
// for after login event auth | ||
$hasRememberMe = $this->request->getSession()->read('hasRememberMe'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a namespace key like Users.hasRememberMe
src/Controller/Traits/LoginTrait.php
Outdated
$hasRememberMe = $this->request->getSession()->read('hasRememberMe'); | ||
if ($hasRememberMe) { | ||
$this->request->data(Configure::read('Users.RememberMe.Cookie.name'), $hasRememberMe); | ||
$this->request->getSession()->delete('hasRememberMe'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a namespace key like Users.hasRememberMe
src/Controller/Traits/LoginTrait.php
Outdated
// store the remember me value from login into session temporarily | ||
// to pass the value to verify action | ||
if (Configure::read('Users.RememberMe.active')) { | ||
$this->request->getSession()->write('hasRememberMe', $this->request->getData(Configure::read('Users.RememberMe.Cookie.name'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an unit test for this
Will do in a month |
I fixed the bug when I'm using google authenticator, the remember me cookie is not working thus the user session will be revoke even if the remember me is checked.
I used session based solution to pass the value without appearing in the url param.
Thanks.