Answer the question
In order to leave comments, you need to log in
Vue how to properly use JWT?
Good afternoon.
Can someone tell me how to use JWT correctly?
Who speaks through interception, who through Vuex.
What is the best option?
generate JWT in login function
const token = jwt.sign({
email: isUser.email,
userId: isUser._id
}, keys.jwt, {expiresIn: 3600})
res.status(200).json({
token: `Bearer ${token}`
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question