fix statistics;
rewrite availability filters; fix availability filters; ProtectedRoute.IsInRole helper
This commit is contained in:
@@ -68,3 +68,8 @@ export async function serverSideAuth({ req, allowedRoles }) {
|
||||
// Return the session if the user is authenticated and has the required role
|
||||
return { session };
|
||||
}
|
||||
// Static method to check if the user has a specific role
|
||||
ProtectedRoute.IsInRole = async (roleName) => {
|
||||
const session = await getSession();
|
||||
return session && session.user && session.user.role === roleName;
|
||||
};
|
||||
Reference in New Issue
Block a user