Testing new supabase structure
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import createClient from "@/lib/supa";
|
||||
|
||||
export default async function getSession() {
|
||||
const supabase = await createClient();
|
||||
const { error, data } = await supabase.auth.getSession();
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return data.session?.user.id;
|
||||
}
|
||||
Reference in New Issue
Block a user