chore(frontend): fixed all eslint errors

This commit is contained in:
akhilmhdh
2023-01-17 21:06:14 +05:30
parent 9f82e2d836
commit cf7834bfc3
184 changed files with 6255 additions and 6117 deletions
@@ -1,8 +1,8 @@
/* eslint-disable new-cap */
import changePassword2 from '@app/pages/api/auth/ChangePassword2';
import SRP1 from '@app/pages/api/auth/SRP1';
import jsrp from 'jsrp';
import changePassword2 from '~/pages/api/auth/ChangePassword2';
import SRP1 from '~/pages/api/auth/SRP1';
import Aes256Gcm from './aes-256-gcm';
const clientOldPassword = new jsrp.client();
@@ -33,15 +33,16 @@ const changePassword = async (
clientOldPassword.init(
{
username: email,
password: currentPassword,
password: currentPassword
},
async () => {
const clientPublicKey = clientOldPassword.getPublicKey();
let serverPublicKey, salt;
let serverPublicKey;
let salt;
try {
const res = await SRP1({
clientPublicKey: clientPublicKey,
clientPublicKey
});
serverPublicKey = res.serverPublicKey;
salt = res.salt;
@@ -57,7 +58,7 @@ const changePassword = async (
clientNewPassword.init(
{
username: email,
password: newPassword,
password: newPassword
},
async () => {
clientNewPassword.createVerifier(async (err, result) => {
@@ -67,11 +68,9 @@ const changePassword = async (
secret: newPassword
.slice(0, 32)
.padStart(
32 +
(newPassword.slice(0, 32).length -
new Blob([newPassword]).size),
32 + (newPassword.slice(0, 32).length - new Blob([newPassword]).size),
'0'
),
)
});
if (ciphertext) {
@@ -87,18 +86,18 @@ const changePassword = async (
tag,
salt: result.salt,
verifier: result.verifier,
clientProof,
clientProof
});
if (res && res.status == 400) {
if (res && res.status === 400) {
setCurrentPasswordError(true);
} else if (res && res.status == 200) {
} else if (res && res.status === 200) {
setPasswordChanged(true);
setCurrentPassword('');
setNewPassword('');
}
} catch (err) {
} catch (error) {
setCurrentPasswordError(true);
console.log(err);
console.log(error);
}
}
});