mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 13:24:27 +00:00
feat: implement public API routes and staff authentication
- Add public API endpoints for locations, services, and availability - Implement staff login system with password authentication - Update auth context to support password sign-in - Protect aperture dashboard with authentication - Update project documentation with new domains
This commit is contained in:
@@ -9,6 +9,7 @@ type AuthContextType = {
|
||||
session: Session | null
|
||||
loading: boolean
|
||||
signIn: (email: string) => Promise<{ error: any }>
|
||||
signInWithPassword: (email: string, password: string) => Promise<{ error: any }>
|
||||
signOut: () => Promise<void>
|
||||
}
|
||||
|
||||
@@ -57,6 +58,14 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
return { error }
|
||||
}
|
||||
|
||||
const signInWithPassword = async (email: string, password: string) => {
|
||||
const { error } = await supabase.auth.signInWithPassword({
|
||||
email,
|
||||
password,
|
||||
})
|
||||
return { error }
|
||||
}
|
||||
|
||||
const signOut = async () => {
|
||||
const { error } = await supabase.auth.signOut()
|
||||
if (error) {
|
||||
@@ -69,6 +78,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
session,
|
||||
loading,
|
||||
signIn,
|
||||
signInWithPassword,
|
||||
signOut,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user