Answer the question
In order to leave comments, you need to log in
How to update access token using JSON Web Token and Passport JWT?
I generate a token:
// jsonwebtoken package - creating token and answer on him
var token = jwt.sign(payload, jwtOptions.secretOrKey, { expiresIn: '10m' });
res.json({token: 'Bearer ' + token});
Answer the question
In order to leave comments, you need to log in
How and where to get a refresh token?
получить refresh_token из тела запроса
если refresh_token в есть базе и он не просрочен
то
сгенерировать новую пару acces_token и refresh_token
сохранить refresh_token в базе данных
иначе
вернуть ошибку что refresh_token недействительный
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question