mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
feature: setup password
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
MfaMethod,
|
||||
ResetPasswordDTO,
|
||||
SendMfaTokenDTO,
|
||||
SetupPasswordDTO,
|
||||
SRP1DTO,
|
||||
SRPR1Res,
|
||||
TOauthTokenExchangeDTO,
|
||||
@@ -286,7 +287,8 @@ export const useResetPassword = () => {
|
||||
encryptedPrivateKeyIV: details.encryptedPrivateKeyIV,
|
||||
encryptedPrivateKeyTag: details.encryptedPrivateKeyTag,
|
||||
salt: details.salt,
|
||||
verifier: details.verifier
|
||||
verifier: details.verifier,
|
||||
password: details.password
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@@ -336,3 +338,23 @@ export const checkUserTotpMfa = async () => {
|
||||
|
||||
return data.isVerified;
|
||||
};
|
||||
|
||||
export const useSendPasswordSetupEmail = () => {
|
||||
return useMutation({
|
||||
mutationFn: async () => {
|
||||
const { data } = await apiRequest.post("/api/v1/password/email/password-setup");
|
||||
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useSetupPassword = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({ verificationToken, ...payload }: SetupPasswordDTO) => {
|
||||
const { data } = await apiRequest.post("/api/v1/password/password-setup", payload);
|
||||
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -133,6 +133,20 @@ export type ResetPasswordDTO = {
|
||||
salt: string;
|
||||
verifier: string;
|
||||
verificationToken: string;
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type SetupPasswordDTO = {
|
||||
protectedKey: string;
|
||||
protectedKeyIV: string;
|
||||
protectedKeyTag: string;
|
||||
encryptedPrivateKey: string;
|
||||
encryptedPrivateKeyIV: string;
|
||||
encryptedPrivateKeyTag: string;
|
||||
salt: string;
|
||||
verifier: string;
|
||||
token: string;
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type IssueBackupPrivateKeyDTO = {
|
||||
|
||||
Reference in New Issue
Block a user