mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 09:12:02 +10:00
🐛 return to login if user was not found (probably deleted in db or token manipulated)🚸
This commit is contained in:
@ -128,7 +128,13 @@ function getStat(name: string, props: any) {
|
||||
|
||||
export async function getServerSideProps(context: any) {
|
||||
const user = await getUserFromToken(context.req, context.res);
|
||||
if (!user) return;
|
||||
if (!user)
|
||||
return {
|
||||
redirect: {
|
||||
destination: "/login",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
|
||||
const documents: any[] = await getDocumentsForUserFromToken(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user