feat: updated ui for srp handover

This commit is contained in:
=
2024-06-12 19:25:06 +05:30
parent 777dfd5f58
commit f3ea7b3dfd
11 changed files with 202 additions and 112 deletions
+16
View File
@@ -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;