M'BOUKOU MONEKENE Aymard Ricardo

Results 12 comments of M'BOUKOU MONEKENE Aymard Ricardo

Hello, I have the same error Format is Authorization: Bearer [token]. I need your help

> Hey @ricardomb94 👋 > > Your first check is to make sure that the token is being sent correctly. You need to make sure a valid token is set...

I made some changes in my code and I got another error: userId is undefined. You are right, I definitly have an authentication problem. This my code to create an...

import React, {useState} from 'react'; import Layout from '../core/Layout'; import {isAuth, getCookie} from '../auth/helpers' import Zoom from 'react-reveal/Zoom'; import Pulse from 'react-reveal/Pulse'; import CreateCategory from './CreateCategory'; const AddCategory = ()...

This is my Routes: router.post('/category/create/:userId', requireSignin, adminMiddleware, create);

James thank you for help.

Thank you James, let me give it a try. I will get back to you in a short while. Le ven. 22 mai 2020 à 13:13, James Drew a écrit...

I am still stuck at the same point. I Changed the space just like you told me but nothing works. I added more elments to my requireSignin to get the...

exports.requireSignin = expressJwt({ secret: process.env.JWT_SECRET, credentialsRequired:false, getToken: (req)=> { if( req.headers && req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer' ){ console.log('REQ HEADERS',req.headers.authorization.split(' ')[1]) return req.headers.authorization.split(' ')[1]; } return null; }, });

Regards, Ricardo