diff --git a/README.md b/README.md index 2ef19b3..10c3174 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn | categories page is need a update, thread count in category | ⚪ | | preview for send messages in markdown format | ⚪ | | DC auth will store code for taking tokens, and create secret model setting | ⚪ | - +- max lengths for html :/ ## Major Version History - V4: Caching - V3: New Theme diff --git a/index.js b/index.js index e9237e8..d000fdf 100644 --- a/index.js +++ b/index.js @@ -42,6 +42,9 @@ app.use(express.static("public"), express.json(), IP(), }, BP({ extended: true }) ); +if (discord_auth) + app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=${host}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`); + if (RLS.enabled) app.use(RL({ ...RLS, handler: (req, res, next, opts) => !req.user?.admin ? res.error(opts.statusCode, "You are begin ratelimited") : next() })); @@ -50,9 +53,4 @@ for (const file of fs.readdirSync("./routes")) app.all("*", (req, res) => res.error(404, "We have not got this page.")); -const server = app.listen(port, () => console.log(`${forum_name}-forum on port:`, port)); - -if (discord_auth) { - const { address } = server.address(); - app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=${host}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`); -} \ No newline at end of file +app.listen(port, () => console.log(`${forum_name}-forum on port:`, port)); \ No newline at end of file diff --git a/views/user.ejs b/views/user.ejs index 276ad59..239e53e 100644 --- a/views/user.ejs +++ b/views/user.ejs @@ -30,9 +30,9 @@

Edit <%= member.name %>

- + - + <% if (user?.admin){ %> Is Admin? >