changed google-auth strategy and removed session use

This commit is contained in:
Sheen Capadngan
2023-05-11 00:37:02 +08:00
parent 074c0bdd77
commit addc849fa6
11 changed files with 75 additions and 238 deletions
@@ -13,12 +13,14 @@ import SecurityClient from '../utilities/SecurityClient';
export default function PasswordInputStep({
email,
password,
providerAuthToken,
setPassword,
setProviderAuthToken,
setStep
}: {
email: string;
password: string;
providerAuthToken: string;
setPassword: (password: string) => void;
setProviderAuthToken: (value: string) => void;
setStep: (step: number) => void;
@@ -34,7 +36,8 @@ export default function PasswordInputStep({
setIsLoading(true);
const loginAttempt = await attemptLogin({
email,
password
password,
providerAuthToken,
});
if (loginAttempt && loginAttempt.success) {
@@ -29,9 +29,11 @@ const attemptLogin = async (
{
email,
password,
providerAuthToken,
}: {
email: string;
password: string;
providerAuthToken?: string;
}
): Promise<IsLoginSuccessful> => {
@@ -48,6 +50,7 @@ const attemptLogin = async (
const { serverPublicKey, salt } = await login1({
email,
clientPublicKey,
providerAuthToken,
});
client.setSalt(salt);
@@ -69,6 +72,7 @@ const attemptLogin = async (
{
email,
clientProof,
providerAuthToken,
}
);