refactor(auth): remove personal code from sign-up flow and update related components

feat(i18n): update translations for company account creation and get started
This commit is contained in:
Danel Kungla
2025-08-21 21:32:03 +03:00
parent 6f67a21cc1
commit cdf1491e53
9 changed files with 13 additions and 42 deletions

View File

@@ -1,10 +1,9 @@
import { useMutation } from '@tanstack/react-query';
import { useSupabase } from './use-supabase';
import { medusaLoginOrRegister } from '../../../features/medusa-storefront/src/lib/data/customer';
import { useSupabase } from './use-supabase';
interface Credentials {
personalCode: string;
email: string;
password: string;
emailRedirectTo: string;
@@ -16,17 +15,14 @@ export function useSignUpWithEmailAndPassword() {
const mutationKey = ['auth', 'sign-up-with-email-password'];
const mutationFn = async (params: Credentials) => {
const { emailRedirectTo, captchaToken, personalCode, ...credentials } = params;
const { emailRedirectTo, captchaToken, ...credentials } = params;
// TODO?: should be a validation of unique personal code before registration
const response = await client.auth.signUp({
...credentials,
options: {
emailRedirectTo,
captchaToken,
data: {
personalCode
}
},
});