mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-10 03:41:25 +03:00
Add authentication
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
module.exports.get = fastify => ({
|
||||
handler: (req, res) => {
|
||||
const { client } = res.context.config;
|
||||
return client.guilds.cache.get(req.params.guild);
|
||||
},
|
||||
onRequest: [fastify.authenticate],
|
||||
});
|
@@ -0,0 +1,9 @@
|
||||
module.exports.get = fastify => ({
|
||||
handler: async (req, res) => {
|
||||
const { client } = res.context.config;
|
||||
const user = await client.users.fetch(req.user.payload.id);
|
||||
console.log(req.user.payload.username, user?.tag);
|
||||
res.send(client.guilds.cache);
|
||||
},
|
||||
onRequest: [fastify.authenticate],
|
||||
});
|
Reference in New Issue
Block a user