tsc
This commit is contained in:
parent
314c8f69f2
commit
621c482529
|
@ -127,7 +127,7 @@ export const updateSRPAndKeys = async (
|
|||
const resp = await HTTPService.post(
|
||||
`${ENDPOINT}/users/srp/update`,
|
||||
updateSRPAndKeyRequest,
|
||||
null,
|
||||
undefined,
|
||||
{
|
||||
"X-Auth-Token": token,
|
||||
},
|
||||
|
|
|
@ -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(),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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<string | null>(null);
|
||||
const [showMessage, setShowMessage] = useState(false);
|
||||
const [success, setSuccess] = useState(false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue