mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 21:40:31 +00:00
feat: updated ui for srp handover
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export {
|
||||
useGetAuthToken,
|
||||
useOauthTokenExchange,
|
||||
useResetPassword,
|
||||
useSelectOrganization,
|
||||
useSendMfaToken,
|
||||
@@ -7,4 +8,5 @@ export {
|
||||
useSendVerificationEmail,
|
||||
useVerifyMfaToken,
|
||||
useVerifyPasswordResetCode,
|
||||
useVerifySignupEmailVerificationCode} from "./queries";
|
||||
useVerifySignupEmailVerificationCode
|
||||
} from "./queries";
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
SendMfaTokenDTO,
|
||||
SRP1DTO,
|
||||
SRPR1Res,
|
||||
TOauthTokenExchangeDTO,
|
||||
VerifyMfaTokenDTO,
|
||||
VerifyMfaTokenRes,
|
||||
VerifySignupInviteDTO
|
||||
@@ -92,6 +93,7 @@ export const useLogin2 = () => {
|
||||
mutationFn: async (details: {
|
||||
email: string;
|
||||
clientProof: string;
|
||||
password: string;
|
||||
providerAuthToken?: string;
|
||||
}) => {
|
||||
return login2(details);
|
||||
@@ -99,6 +101,20 @@ export const useLogin2 = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const oauthTokenExchange = async (details: TOauthTokenExchangeDTO) => {
|
||||
const { data } = await apiRequest.post<Login2Res>("/api/v1/sso/token-exchange", details);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const useOauthTokenExchange = () => {
|
||||
// note: use after srp1
|
||||
return useMutation({
|
||||
mutationFn: async (details: TOauthTokenExchangeDTO) => {
|
||||
return oauthTokenExchange(details);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const srp1 = async (details: SRP1DTO) => {
|
||||
const { data } = await apiRequest.post<SRPR1Res>("/api/v1/password/srp1", details);
|
||||
return data;
|
||||
|
||||
@@ -23,6 +23,11 @@ export type VerifyMfaTokenRes = {
|
||||
tag: string;
|
||||
};
|
||||
|
||||
export type TOauthTokenExchangeDTO = {
|
||||
providerAuthToken: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export type Login1DTO = {
|
||||
email: string;
|
||||
clientPublicKey: string;
|
||||
@@ -34,6 +39,7 @@ export type Login2DTO = {
|
||||
email: string;
|
||||
clientProof: string;
|
||||
providerAuthToken?: string;
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type Login1Res = {
|
||||
@@ -86,6 +92,7 @@ export type CompleteAccountDTO = {
|
||||
encryptedPrivateKeyTag: string;
|
||||
salt: string;
|
||||
verifier: string;
|
||||
password: string;
|
||||
};
|
||||
|
||||
export type CompleteAccountSignupDTO = CompleteAccountDTO & {
|
||||
|
||||
Reference in New Issue
Block a user