Skip to content
This repository was archived by the owner on Jul 9, 2021. It is now read-only.
This repository was archived by the owner on Jul 9, 2021. It is now read-only.

JWT: Can see token contents without payload #22

@venkytt

Description

@venkytt

Hello

The documentation is not very clear when it comes to my understanding of the following.

Consider a JWT token is created in nodejs:

token() {
const payload= {
exp: moment()
.add(jwtExpirationInterval, "minutes")
.unix(),
iat: moment().unix(),
sub: this._id
};
return nJwt.create(playload, jwtSecret,"HS256").compact();
},

Now, without the "jwtSecret", I am able to see the "payload";

So, there is something wrong in my encoding, right? OR Is the secret key used ONLY to verify the payload?

many thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions