diff --git a/functions/util/fbAuth.js b/functions/util/fbAuth.js index 04d71ed..a9243cc 100644 --- a/functions/util/fbAuth.js +++ b/functions/util/fbAuth.js @@ -7,8 +7,8 @@ module.exports = (req, res, next) => { let idToken; // Checking that the token exists in the header of the request - if (req.headers.authorization) { - idToken = req.headers.authorization; + if (req.headers.authorization && req.headers.authorization.startsWith('Bearer ')) { + idToken = req.headers.authorization.split('Bearer ')[1]; } else { console.error('No token found'); return res.status(403).json({ error: 'Unauthorized'});