Parent Directory
|
Revision Log
chore: add old version archive branches (2.x to 9.x-dev)
1 | rakinar2 | 577 | import { NextFunction, Request, Response } from "express"; |
2 | import DiscordClient from "../client/Client"; | ||
3 | |||
4 | export default function guildAuth(req: Request, res: Response, next: NextFunction) { | ||
5 | let token = req.body.token; | ||
6 | |||
7 | if (!token) | ||
8 | token = req.query.token; | ||
9 | |||
10 | if (!req.params.guild || !token || !DiscordClient.client.server.verifyToken(req.params.guild, token)) { | ||
11 | res.status(403).json({ | ||
12 | status: 403, | ||
13 | message: "Forbidden", | ||
14 | detail: "You don't have permission to access this resource" | ||
15 | }); | ||
16 | |||
17 | return; | ||
18 | } | ||
19 | |||
20 | next(); | ||
21 | }; |
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |