migration

This commit is contained in:
Théo LAGACHE
2025-05-16 15:54:17 +02:00
parent 01019fe1a3
commit 6f2523e524
285 changed files with 15492 additions and 46090 deletions
-36
View File
@@ -1,36 +0,0 @@
"use server"
import {redirect} from "next/navigation";
import {signIn, signOut} from "@/auth/auth";
import {setCurrentOrganizationSlug} from "@/features/dashboard/organization-cookie";
export const signOutAction = async () => {
const deleteCookieResponse = await setCurrentOrganizationSlug("");
await signOut({ redirectTo: '/', redirect: true });
// if (typeof window !== 'undefined') {
// window.location.reload();
// }
return deleteCookieResponse;
};
export const signInAction = async (type: string, formData?: any) => {
if (type === "google") {
await setCurrentOrganizationSlug("default");
await signIn(type, {redirectTo: '/dashboard'})
} else {
try {
await setCurrentOrganizationSlug("default");
await signIn(type, {
redirect: false,
password: formData.password,
email: formData.email
});
} catch (error) {
return {error: "Error loging in, please try again or check your credentials !"};
}
redirect("/")
}
}