mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 03:29:35 +00:00
47 lines
951 B
TypeScript
47 lines
951 B
TypeScript
import { apiRequest } from "@app/config/request";
|
|
|
|
interface Props {
|
|
clientProof: string;
|
|
protectedKey: string;
|
|
protectedKeyIV: string;
|
|
protectedKeyTag: string;
|
|
encryptedPrivateKey: string;
|
|
encryptedPrivateKeyIV: string;
|
|
encryptedPrivateKeyTag: string;
|
|
salt: string;
|
|
verifier: string;
|
|
}
|
|
|
|
/**
|
|
* This is the second step of the change password process (pake)
|
|
* @param {*} clientPublicKey
|
|
* @returns
|
|
*/
|
|
const changePassword2 = async ({
|
|
clientProof,
|
|
protectedKey,
|
|
protectedKeyIV,
|
|
protectedKeyTag,
|
|
encryptedPrivateKey,
|
|
encryptedPrivateKeyIV,
|
|
encryptedPrivateKeyTag,
|
|
salt,
|
|
verifier
|
|
}: Props) => {
|
|
const { data } = await apiRequest.post('/api/v1/password/change-password', {
|
|
clientProof,
|
|
protectedKey,
|
|
protectedKeyIV,
|
|
protectedKeyTag,
|
|
encryptedPrivateKey,
|
|
encryptedPrivateKeyIV,
|
|
encryptedPrivateKeyTag,
|
|
salt,
|
|
verifier
|
|
});
|
|
|
|
return data;
|
|
}
|
|
|
|
export default changePassword2;
|