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:
Marco Gallegos
2026-01-16 21:45:47 -06:00
parent 0f6fe9bf7b
commit fb60178c86
8 changed files with 273 additions and 1 deletions

View File

@@ -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,
}