I’m making a Discord dashboard website and thanks to earlier help from a user for the data displaying issue. Now I am wondering that when you login with Discord Oauth2. Is it possible to only have certain people (whitelisting people via Discord User ID) access the dashboard/some pages and if there are others attempting to access and they authorize with Discord. They get a denied page error.
I’m pretty sure its possible to do with Express and Passport, I am kinda familiar with how Express works in terms of Discord Dashboard/Oauth. Just wondering over how this can be done.
Now for an Issue I have, I am trying to get one of the pages to display all the User’s Guilds which has their Server Icon, Server Name, ID, Creation etc. in the one page. I can’t seem to get it working and I tried this:
app.get("/profile", checkAuth, function(request, response) {
response.render(__dirname + '/public/profile.ejs', {
tag: request.user.username + " #" + request.user.discriminator,
username: request.user.username,
bannedbyuser: request.user.username + "#" + request.user.discriminator + " [" + request.user.id + "]",
id: request.user.id,
discrim: request.user.discriminator,
email: request.user.email,
locale: request.user.locale,
connections: request.user.connections,
guildname: request.user.guilds,
avatar: "https://cdn.discordapp.com/avatars/" + request.user.id + "/" + request.user.avatar + ".png?size=2048",
guildowner: request.user.guilds.owner,
});
})
and in profile.ejs (page to view the profile), I have this in one of the lines to display the guilds
<%=`${guildname}` %>
Well funny story, the [object Object] correctly numbers the amount of servers im in. My one being 96 Servers.
Project Name: natebot-evidence