Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jwt created by verify() is not setting signingKey #35

Open
safm opened this issue Oct 31, 2016 · 2 comments
Open

Jwt created by verify() is not setting signingKey #35

safm opened this issue Oct 31, 2016 · 2 comments
Labels

Comments

@safm
Copy link

safm commented Oct 31, 2016

Calling .compact() on jwt returned by verify method is throwing an error.

njwt.verify( token, signinKey, function ( err, jwt ) {
    if ( err ) {
        console.log( "error", err, "\n\n" );
        res.send( 401 );
    } else {
    	jwt.setExpiration();
        var new_token = jwt.compact(); //this line throws an error "Signing key is required"
        res.status( 200 ).send( "You are logged out" );
    }
} );
@robertjd
Copy link
Contributor

Hi @safm , thanks for the bug report. Are you able to work around it by calling jwt.setSigningKey(signinKey); before you call jwt.setExpiration(); ? Thank you.

@robertjd robertjd added the bug label Oct 31, 2016
@safm
Copy link
Author

safm commented Nov 1, 2016

Hi @robertjd, yes the work around worked for me.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants