Fixed a problem where users were being redirected to the dashboard
This commit is contained in:
@@ -27,8 +27,7 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res, query })
|
|||||||
const loginDestination = Buffer.from(req.url || "/").toString("base64")
|
const loginDestination = Buffer.from(req.url || "/").toString("base64")
|
||||||
if (!user) return redirect(`/login?destination=${loginDestination}`)
|
if (!user) return redirect(`/login?destination=${loginDestination}`)
|
||||||
|
|
||||||
if (shouldRedirectHome(user) || checkAccess(user, ["corporate", "mastercorporate"]))
|
if (shouldRedirectHome(user)) return redirect("/")
|
||||||
return redirect("/")
|
|
||||||
|
|
||||||
const { assignment: assignmentID, destination } = query as { assignment?: string, destination?: string }
|
const { assignment: assignmentID, destination } = query as { assignment?: string, destination?: string }
|
||||||
const destinationURL = !!destination ? Buffer.from(destination, 'base64').toString() : undefined
|
const destinationURL = !!destination ? Buffer.from(destination, 'base64').toString() : undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user