Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Dashboard #59

Open
Ryann-Devv opened this issue Aug 15, 2022 · 1 comment
Open

Dashboard #59

Ryann-Devv opened this issue Aug 15, 2022 · 1 comment

Comments

@Ryann-Devv
Copy link
Contributor

this happend when i try to launch the dashboard

[error] Failed to launch dashboard : "Cannot find module './auth/CheckAuth'\n" +
'Require stack:\n' +
'- /root/automod-bot/dashboard/app.js\n' +
'- /root/automod-bot/bot.js'

@Gaster2678
Copy link

Add folder auth and in it CheckAuth.js
in this file, enter:

module.exports = async (req, res, next) => {
if(!req.session.user){
const redirectURL = ((req.originalUrl.includes("login") || req.originalUrl === "/") ? "/selector" : req.originalUrl);
const state = Math.random().toString(36).substring(5);
req.client.states[state] = redirectURL;
return res.redirect(/api/login?state=${state});
}
return next();
};

Everything worked for me after that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants