From 621c482529322014e947d1c884db7d9d61c271d3 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sat, 25 May 2024 16:24:52 +0530 Subject: [PATCH] tsc --- web/packages/accounts/api/srp.ts | 2 +- web/packages/accounts/api/user.ts | 31 ++++++++++--------- .../accounts/components/ChangeEmail.tsx | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/web/packages/accounts/api/srp.ts b/web/packages/accounts/api/srp.ts index 8223edd9d..a9af2c15e 100644 --- a/web/packages/accounts/api/srp.ts +++ b/web/packages/accounts/api/srp.ts @@ -127,7 +127,7 @@ export const updateSRPAndKeys = async ( const resp = await HTTPService.post( `${ENDPOINT}/users/srp/update`, updateSRPAndKeyRequest, - null, + undefined, { "X-Auth-Token": token, }, diff --git a/web/packages/accounts/api/user.ts b/web/packages/accounts/api/user.ts index c7fa4c7b8..d14402ebe 100644 --- a/web/packages/accounts/api/user.ts +++ b/web/packages/accounts/api/user.ts @@ -66,14 +66,10 @@ export const logout = async () => { }; export const verifyTwoFactor = async (code: string, sessionID: string) => { - const resp = await HTTPService.post( - `${ENDPOINT}/users/two-factor/verify`, - { - code, - sessionID, - }, - null, - ); + const resp = await HTTPService.post(`${ENDPOINT}/users/two-factor/verify`, { + code, + sessionID, + }); return resp.data as UserVerificationResponse; }; @@ -108,7 +104,7 @@ export const changeEmail = async (email: string, ott: string) => { email, ott, }, - null, + undefined, { "X-Auth-Token": getToken(), }, @@ -127,7 +123,7 @@ export const setupTwoFactor = async () => { const resp = await HTTPService.post( `${ENDPOINT}/users/two-factor/setup`, null, - null, + undefined, { "X-Auth-Token": getToken(), }, @@ -148,7 +144,7 @@ export const enableTwoFactor = async ( twoFactorSecretDecryptionNonce: recoveryEncryptedTwoFactorSecret.nonce, }, - null, + undefined, { "X-Auth-Token": getToken(), }, @@ -156,12 +152,17 @@ export const enableTwoFactor = async ( }; export const setRecoveryKey = (token: string, recoveryKey: RecoveryKey) => - HTTPService.put(`${ENDPOINT}/users/recovery-key`, recoveryKey, null, { + HTTPService.put(`${ENDPOINT}/users/recovery-key`, recoveryKey, undefined, { "X-Auth-Token": token, }); export const disableTwoFactor = async () => { - await HTTPService.post(`${ENDPOINT}/users/two-factor/disable`, null, null, { - "X-Auth-Token": getToken(), - }); + await HTTPService.post( + `${ENDPOINT}/users/two-factor/disable`, + null, + undefined, + { + "X-Auth-Token": getToken(), + }, + ); }; diff --git a/web/packages/accounts/components/ChangeEmail.tsx b/web/packages/accounts/components/ChangeEmail.tsx index c3b4725a7..1fb3e734a 100644 --- a/web/packages/accounts/components/ChangeEmail.tsx +++ b/web/packages/accounts/components/ChangeEmail.tsx @@ -24,7 +24,7 @@ interface formValues { function ChangeEmailForm({ appName }: PageProps) { const [loading, setLoading] = useState(false); const [ottInputVisible, setShowOttInputVisibility] = useState(false); - const [email, setEmail] = useState(null); + const [email, setEmail] = useState(null); const [showMessage, setShowMessage] = useState(false); const [success, setSuccess] = useState(false);