Skip to content

Commit

Permalink
crazy 503
Browse files Browse the repository at this point in the history
  • Loading branch information
yesBad committed Dec 12, 2024
1 parent fa133bb commit 3474098
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ app.get('/', requiresAuth(), (req, res) => {
} catch (e) { console.warn(e) }
});

app.get('/503', (req, res) => {
try {
if (req?.oidc?.accessToken) {
res.redirect(redirectee);
return;
};
res.send(`
<html>
<head>
<meta http-equiv="refresh" content="0; url=${config.baseURL}" />
</head>
<body>
<p><a href="${config.baseURL}">No permission, login again?</a></p>
</body>
</html>
`)
} catch (e) { console.warn(e) }
});


app.use('/', requiresAuth(), express.static('serve'));

app.listen(port, function () {
Expand Down

0 comments on commit 3474098

Please sign in to comment.