mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-16 02:38:51 +00:00
feat(password-recovery): Avoid removing XSRF token cookie on passwordRecoveryCheck request
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -187,7 +187,7 @@
|
||||
// Clean cookies for reauthenticate
|
||||
$cookies.remove('XSRF-TOKEN', { path: '/SOGo/' });
|
||||
$cookies.remove('0xHIGHFLYxSOGo', { path: '/SOGo/' });
|
||||
|
||||
|
||||
d.resolve({url: redirectUrl(userName, domain)});
|
||||
}, function(response) {
|
||||
var error,
|
||||
@@ -310,23 +310,15 @@
|
||||
passwordRecoveryEnabled: function (userName, domain) {
|
||||
const self = this;
|
||||
|
||||
var d = $q.defer(),
|
||||
xsrfCookie = $cookies.get('XSRF-TOKEN');
|
||||
|
||||
$cookies.remove('XSRF-TOKEN', { path: '/SOGo/' });
|
||||
var d = $q.defer();
|
||||
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: '/SOGo/so/passwordRecoveryEnabled',
|
||||
headers: {
|
||||
'X-XSRF-TOKEN': xsrfCookie
|
||||
},
|
||||
data: { userName: userName, domain: domain }
|
||||
}).then(function (response) {
|
||||
d.resolve(response.data.domain);
|
||||
}, function () {
|
||||
// Restore the cookie
|
||||
$cookies.put('XSRF-TOKEN', xsrfCookie, { path: '/SOGo/' });
|
||||
d.reject();
|
||||
});
|
||||
return d.promise;
|
||||
|
||||
Reference in New Issue
Block a user