Added body support
This commit is contained in:
@@ -64,7 +64,7 @@ router.post('/login', requestLimiter, async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.post('/verify', requestLimiter, async (req, res) => {
|
router.post('/verify', requestLimiter, async (req, res) => {
|
||||||
const token = req.headers.authorization;
|
const token = req.headers.authorization || req.body.token;
|
||||||
if (!token) return await respondWithStatus(res, 401, 'No token provided');
|
if (!token) return await respondWithStatus(res, 401, 'No token provided');
|
||||||
try {
|
try {
|
||||||
const decoded = jwt.verify(token, process.env.JWT_SECRET);
|
const decoded = jwt.verify(token, process.env.JWT_SECRET);
|
||||||
|
|||||||
Reference in New Issue
Block a user