Added 'No show' status. Edit user profile

This commit is contained in:
Jose Selesan
2026-04-09 23:01:09 -03:00
parent 4dcaae7136
commit 2d86881f94
7 changed files with 440 additions and 45 deletions

View File

@@ -21,6 +21,14 @@ type SignUpParams = {
fullName: string
}
type UpdateProfileParams = {
fullName: string
}
type UpdatePasswordParams = {
password: string
}
export type AuthContextValue = {
user: User | null
session: Session | null
@@ -31,6 +39,8 @@ export type AuthContextValue = {
avatarUrl: string | null
signInWithPassword: (params: SignInParams) => Promise<void>
signUp: (params: SignUpParams) => Promise<{ requiresEmailConfirmation: boolean }>
updateProfile: (params: UpdateProfileParams) => Promise<void>
updatePassword: (params: UpdatePasswordParams) => Promise<void>
signOut: () => Promise<void>
}
@@ -143,6 +153,27 @@ export function AuthProvider({ children }: PropsWithChildren) {
requiresEmailConfirmation: !data.session,
}
},
updateProfile: async ({ fullName }) => {
const { error } = await supabase.auth.updateUser({
data: {
full_name: fullName,
name: fullName,
},
})
if (error) {
throw error
}
},
updatePassword: async ({ password }) => {
const { error } = await supabase.auth.updateUser({
password,
})
if (error) {
throw error
}
},
signOut: async () => {
const { error } = await supabase.auth.signOut()
if (error) {