feat(password-recovery): Avoid removing XSRF token cookie on passwordRecoveryCheck request

This commit is contained in:
smizrahi
2022-10-25 14:48:30 +02:00
parent 43b81bf9fd
commit 9b023f43d5
3 changed files with 4 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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;