15 lines
323 B
TypeScript
15 lines
323 B
TypeScript
import type { Session } from "next-auth"
|
|
|
|
export function isValidClientSession(session: Session | null) {
|
|
if (!session) {
|
|
console.log("No session available (user not authenticated).")
|
|
return false
|
|
}
|
|
if (session.error) {
|
|
console.log(`Session error: ${session.error}`)
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|