Update signUp method to use AeThex adapter
cgen-ad1f6414702145be9e6f2e473a8b58f7
This commit is contained in:
parent
74a8b67cae
commit
d40d3e2a62
1 changed files with 6 additions and 10 deletions
|
|
@ -132,7 +132,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const signUp = async (email: string, password: string, userData?: Partial<UserProfile>) => {
|
const signUp = async (email: string, password: string, userData?: Partial<AethexUserProfile>) => {
|
||||||
if (!isSupabaseConfigured) {
|
if (!isSupabaseConfigured) {
|
||||||
aethexToast.warning({
|
aethexToast.warning({
|
||||||
title: 'Demo Mode',
|
title: 'Demo Mode',
|
||||||
|
|
@ -150,15 +150,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
if (data.user && userData) {
|
if (data.user && userData) {
|
||||||
// Create user profile after successful signup
|
// Create user profile using AeThex adapter
|
||||||
const { error: profileError } = await supabase
|
await aethexUserService.createInitialProfile(data.user.id, {
|
||||||
.from('user_profiles')
|
...userData,
|
||||||
.insert({
|
email,
|
||||||
id: data.user.id,
|
});
|
||||||
...userData,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (profileError) throw profileError;
|
|
||||||
|
|
||||||
aethexToast.success({
|
aethexToast.success({
|
||||||
title: 'Account created!',
|
title: 'Account created!',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue