Skip to content

Commit

Permalink
add unauthorized page
Browse files Browse the repository at this point in the history
  • Loading branch information
oohwooh committed Jun 26, 2024
1 parent 4b4bb09 commit c2308f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/pages/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export async function getServerSideProps({req, res, query}) {
const session = await getSession({req});
const fetch = getFetcher(session);
if (!session) return {props: {}};
if(!session.clearAuthToken) return {redirect: { destination:'/unauthorized', permanent:false }}
const eventResults = await fetch(
getEvents,
session.isAdmin ? null : { where: [{ managers: { hasSome: [session.user.nickname] } }] }
Expand Down
1 change: 0 additions & 1 deletion src/pages/unauthorized.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function Unauthorized() {
<Text>I'm sorry, but I'm not allowed to let you in here.
<br/>
If you feel this is in error, please ask your CodeDay point of contact.</Text>
<Link href="/">Go home</Link>
</Box>
</Page>
);
Expand Down

0 comments on commit c2308f0

Please sign in to comment.