PWA manager is now visible to all users
This commit is contained in:
@ -64,13 +64,23 @@ export const getServerSideProps = async (context) => {
|
||||
}
|
||||
});
|
||||
if (!item) {
|
||||
const user = context.req.session.user;
|
||||
const user = context.req.session?.user;
|
||||
if (!user) {
|
||||
return {
|
||||
// redirect to '/auth/signin'. assure it is not relative path
|
||||
redirect: {
|
||||
destination: process.env.NEXT_PUBLIC_PUBLIC_URL + "/auth/signin",
|
||||
permanent: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
const message = encodeURIComponent(`Този имейл (${user?.email}) не е регистриран. Моля свържете се с администратора.`);
|
||||
return {
|
||||
redirect: {
|
||||
destination: '/message?message=Този имейл (' + user.email + ') не е регистриран. Моля свържете се с администратора.',
|
||||
destination: `/message?message=${message}`,
|
||||
permanent: false,
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
// item.allShifts = item.assignments.map((a: Assignment[]) => a.shift);
|
||||
|
||||
|
Reference in New Issue
Block a user