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

Dashboard Error! #49

Open
muralianand12345 opened this issue Jul 17, 2022 · 11 comments
Open

Dashboard Error! #49

muralianand12345 opened this issue Jul 17, 2022 · 11 comments

Comments

@muralianand12345
Copy link

`Cannot find module './auth/CheckAuth'
Require stack:

  • C:\Users\smura\Desktop\automod-bot-main\dashboard\app.js
  • C:\Users\smura\Desktop\automod-bot-main\bot.js`

The file doesn't exist
I think the file is incomplete.

@ghost
Copy link

ghost commented Jul 19, 2022

Hey! inside of the dashboard folder, make a new folder called "auth" than inside of that folder make a file called "CheckAuth.js". Reply back to this so i can give you the next step!

@muralianand12345
Copy link
Author

yeah done till what you typed

@ElTayArin
Copy link

`Cannot find module './auth/CheckAuth' Require stack:

  • C:\Users\smura\Desktop\automod-bot-main\dashboard\app.js
  • C:\Users\smura\Desktop\automod-bot-main\bot.js`

The file doesn't exist I think the file is incomplete.

I have the same error, so ill keep an eye on this issue

@ElTayArin
Copy link

Sorry, i forgot to add this:

[error] Failed to launch dashboard : 'Route.get() requires a callback function but got a [object Object]'

@ghost
Copy link

ghost commented Jul 27, 2022

it will be easier to help if u guys wanna dm my discord. Sparky0103#0103

@SlyRaccoon2
Copy link

Where do I get BOT SECRET/SESSION_PASSWORD?

@Stacksyz
Copy link

Where do I get BOT SECRET/SESSION_PASSWORD?

Bot Secret: go to Discord Developer Portal
Go to your application/bot and go to the oAuth2 Tab
Click on the blue "Reset Secret" button.
Enter 2fa code if you have that enabled.
otherwise there you go.

Session_Password: This is not something you can get really.
You just have to make up a secure password looking code
I suggest using this: Password Generator
Here you can generate a password you can use for the Session_Password

@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

@flexhd41
Copy link

hey i tried that and i get an error INFO Launching dashboard
21:15:56.031 ERROR Launching dashboard Invalid regular expression flags
{}
C:\Users\timm\Desktop\DiscordJS-Ticket-V13-master\ticket-bot\automod-bot\automod-bot\dashboard\auth\CheckAuth.js:6
return res.redirect(/api/login?state=${state});

@Gaster2678
Copy link

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();
};

Sorry, I rewrote it incorrectly
you also need to fill in this line in the Discord Developer Portal as in the picture!

Скриншот 14-09-2022 144042

@flexhd41
Copy link

flexhd41 commented Dec 4, 2022

works thanks

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

6 participants