mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 03:01:59 +10:00
🐛 return to login if user was not found (probably deleted in db or token manipulated)🚸
This commit is contained in:
@ -109,7 +109,13 @@ function formatDocumentStatus(status: DocumentStatus) {
|
||||
|
||||
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 { id: documentId } = context.query;
|
||||
|
||||
|
||||
@ -442,7 +442,13 @@ RecipientsPage.getLayout = function getLayout(page: ReactElement) {
|
||||
|
||||
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 { id: documentId } = context.query;
|
||||
const document: PrismaDocument = await getDocument(
|
||||
|
||||
Reference in New Issue
Block a user