import { EAuthStep } from '@/modules/auth';
import { Ref } from 'vue';

export const useInitAuthState = (
    initialEmail: string,
    emailVerifiedAt: string | null,
    userEmail: Ref<string>,
    authStep: Ref<EAuthStep>,
) => {
    if (initialEmail) {
        userEmail.value = initialEmail;
        authStep.value = emailVerifiedAt ? EAuthStep.confirmed : EAuthStep.confirm;
    } else {
        authStep.value = EAuthStep.input;
    }
};
