Created
October 13, 2019 12:34
-
-
Save luandevpro/82581387f22f186c16f36224966031c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import withFirebase from '../../../middlewares/withFirebase'; | |
async function handle(req, res) { | |
const token = req.cookies.token || req.headers.authorization; | |
if (token) { | |
console.log(token, 'token'); | |
res.status(200).json({ token }); | |
} else { | |
res.status(400).json({ message: 'Not authorized! Go back!' }); | |
} | |
} | |
export default withFirebase(handle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment