-
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,14 @@ public function verify() | |
|
||
$user['secret_verified'] = true; | ||
} | ||
|
||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. Please use a namespace key like Users.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 commentThe reason will be displayed to describe this comment to others. Learn more. Please add a unit test for this |
||
$this->request->getSession()->delete('hasRememberMe'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use a namespace key like Users.hasRememberMe |
||
} | ||
|
||
$this->request->getSession()->delete('temporarySession'); | ||
$this->Auth->setUser($user); | ||
|
@@ -339,6 +347,13 @@ protected function _afterIdentifyUser($user, $socialLogin = false, $googleAuthen | |
// storing user's session in the temporary one | ||
// until the GA verification is checked | ||
$this->request->getSession()->write('temporarySession', $user); | ||
|
||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. Please add an unit test for this |
||
} | ||
|
||
$url = Configure::read('GoogleAuthenticator.verifyAction'); | ||
$url = array_merge($url, [ | ||
'?' => $this->request->getQueryParams() | ||
|
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