only use blocked date and no published date for blocking;

allow any date to be selected as block date - not only the end of the month
This commit is contained in:
Dobromir Popov
2024-09-17 23:18:51 +03:00
parent 1d4696f0f7
commit bab62816b0
7 changed files with 699 additions and 22 deletions

View File

@ -85,5 +85,10 @@ export async function serverSideAuth({ req, allowedRoles }) {
// 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;
};
return (session && session.user && session.user.role === roleName) || false;
};
ProtectedRoute.GetCurrentUserId = async () => {
const session = await getSession();
return session && session.user && session.user.id;
}