Fix status codes of 2fa routes

This commit is contained in:
Girish Ramakrishnan
2023-09-13 21:07:07 +05:30
parent 348eb16cef
commit 4997ad0468
2 changed files with 6 additions and 6 deletions

View File

@@ -2389,7 +2389,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
post('/api/v1/profile/twofactorauthentication_secret', data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 201) return callback(new ClientError(status, data));
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
@@ -2402,7 +2402,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
post('/api/v1/profile/twofactorauthentication_enable', data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 202) return callback(new ClientError(status, data));
if (status !== 204) return callback(new ClientError(status, data));
callback(null);
});
@@ -2415,7 +2415,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
post('/api/v1/profile/twofactorauthentication_disable', data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 202) return callback(new ClientError(status, data));
if (status !== 204) return callback(new ClientError(status, data));
callback(null);
});