Skip to content

Instantly share code, notes, and snippets.

View raulmelo's full-sized avatar

Raul melo raulmelo

View GitHub Profile
import { promisify } from 'util';
import jwt from 'jsonwebtoken';
import authConfig from '../../config/auth';
export default async (req, res, next) => {
const authHeader = req.headers.authorization;
if (!authHeader) {
return res.status(401).json({ error: 'Não autenticado!' });
}