Answer the question
In order to leave comments, you need to log in
What is the correct way to follow a secure link using Json Web Token?
A token is sent from the server after verifying the login and password.
req.login(user, {session: false}, (err)=>{
if(err){
res.send(err);
}
if(res) {
let payload = {id: user.username};
const token = jwt.sign(payload, secretKey);
return res.json({token: token});
}
$.ajax({
url: post_url,
type: request_method,
data: form_data
}).done(function(response){
localStorage.setItem("token", response.token);
});
Answer the question
In order to leave comments, you need to log in
After saving the token, nothing happens further, it turns out that you need to manually immediately follow the new link
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question