Add theme & tvmode

This commit is contained in:
2025-03-18 14:01:04 -05:00
parent 94d1d1cfbf
commit f9e50add6f
22 changed files with 2309 additions and 2983 deletions

View File

@ -0,0 +1,47 @@
'use server'
import 'server-only';
import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'
import { createClient } from '@/utils/supabase/server'
export const login = async (formData: FormData) => {
const supabase = await createClient()
// type-casting here for convenience
// in practice, you should validate your inputs
const data = {
email: formData.get('email') as string,
password: formData.get('password') as string,
}
const { error } = await supabase.auth.signInWithPassword(data)
if (error) {
redirect('/error')
}
revalidatePath('/', 'layout')
redirect('/account')
};
export const signup = async (formData: FormData) => {
const supabase = await createClient()
// type-casting here for convenience
// in practice, you should validate your inputs
const data = {
email: formData.get('email') as string,
password: formData.get('password') as string,
}
const { error } = await supabase.auth.signUp(data)
if (error) {
redirect('/error')
}
revalidatePath('/', 'layout')
redirect('/account')
};