mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #2907 from dhensby/patch-1
FIX Log out current member when forgotten password
This commit is contained in:
commit
3e57cc069e
@ -634,6 +634,11 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
if(isset($_REQUEST['t']) && $member && $member->validateAutoLoginToken($_REQUEST['t'])) {
|
||||
// On first valid password reset request redirect to the same URL without hash to avoid referrer leakage.
|
||||
|
||||
// if there is a current member, they should be logged out
|
||||
if ($curMember = Member::currentUser()) {
|
||||
$curMember->logOut();
|
||||
}
|
||||
|
||||
// Store the hash for the change password form. Will be unset after reload within the ChangePasswordForm.
|
||||
Session::set('AutoLoginHash', $member->encryptWithUserSettings($_REQUEST['t']));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user