mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Authentication with Credentials is working and setup, same for OAuth with Google.
This commit is contained in:
@@ -3,20 +3,16 @@ import {User} from "@prisma/client";
|
||||
|
||||
export const currentUser = async () => {
|
||||
const session = await baseAuth();
|
||||
|
||||
if (!session?.user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return session.user as User;
|
||||
}
|
||||
|
||||
export const requiredCurrentUser = async () => {
|
||||
const user = await currentUser();
|
||||
|
||||
if (!user) {
|
||||
throw new Error("User not found");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user