mirror of
https://github.com/OwethuManagedServices/oms-website-nextjs.git
synced 2025-12-17 17:28:09 +00:00
feature: sign up with github and about page completed
This commit is contained in:
18
actions/auth-action.ts
Normal file
18
actions/auth-action.ts
Normal file
@ -0,0 +1,18 @@
|
||||
// app/actions.ts (or lib/actions.ts)
|
||||
"use server"; // <--- IMPORTANT: This file contains Server Actions
|
||||
|
||||
import { signIn as nextAuthSignIn, signOut as nextAuthSignOut } from "@/auth";
|
||||
|
||||
// Define your server action to handle sign-in
|
||||
export async function handleSignInAction(provider: string = "github") {
|
||||
// You can add any pre-sign-in logic here if needed
|
||||
await nextAuthSignIn(provider);
|
||||
// You can add any post-sign-in logic or revalidates here
|
||||
}
|
||||
|
||||
// Define your server action to handle sign-out
|
||||
export async function handleSignOutAction() {
|
||||
// You can add any pre-sign-out logic here if needed
|
||||
await nextAuthSignOut();
|
||||
// You can add any post-sign-out logic or revalidates here
|
||||
}
|
||||
Reference in New Issue
Block a user