diff --git a/config.json.example b/config.json.example index 9e5eded..c652123 100644 --- a/config.json.example +++ b/config.json.example @@ -13,5 +13,6 @@ "max": 25, "windowMs": 60000 }, - "discord_auth": false + "discord_auth": false, + "host": "akf-forum.glitch.me" } \ No newline at end of file diff --git a/index.js b/index.js index e3ff07e..3d583c9 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const { urlencoded: BP } = require('body-parser'), SES = require('express-session'); const - { def_theme, forum_name, description, limits, global_ratelimit: RLS, discord_auth } = require("./config.json"), + { def_theme, forum_name, description, limits, global_ratelimit: RLS, discord_auth, host } = require("./config.json"), { UserModel, BanModel } = require("./models"), port = process.env.PORT || 3000, mongoose = require("mongoose"), @@ -54,6 +54,5 @@ const server = app.listen(port, () => console.log(`${forum_name}-forum on port:` if (discord_auth) { const { address } = server.address(); - console.log(`https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${address == '::' ? 'localhost:' + port : address}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`) - app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${address == '::' ? 'localhost:' + port : address}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`); + app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${host}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`); } \ No newline at end of file