19 lines
469 B
TypeScript
19 lines
469 B
TypeScript
"use server";
|
|
|
|
import { auth, signIn, signOut } from "@/auth";
|
|
|
|
export async function handleGoogleLogin() {
|
|
await signIn("google", {redirectTo: "/"})
|
|
|
|
}
|
|
|
|
export async function checkGoogleSession() {
|
|
const session = await auth();
|
|
return session;
|
|
}
|
|
|
|
export async function handleGoogleLogout() {
|
|
await signOut({redirectTo: "/login"})
|
|
}
|
|
|
|
// creates our functions to check session, login, logout using functions we exported from auth's nextauth functions
|