Next.js Discord

Discord Forum

Using JWT for context in Next JS frontend app

Unanswered
Ragdoll posted this in #help-forum
Open in Discord
Avatar
RagdollOP
I have an express api with an authentication route, and I need to know how to setup context authentication via a JWT in a front end Next JS app. This is an example of the JWT I get back from the api auth request:
{
"tkn": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Impnv9wer8gy9348hg9vianZhbmRleWFyQG5tZy5jby56YSIsInJvbGUiOiJBZG1pbiIsImRlcGFydG1lbnQiOiJPdGhlciIsImlhdCI6MTY4OTAwNjc0OX0.ZJiIO62am6JT6BkRMeW_2UbNGN-cIHQ_nsY6UJWFBRQ",
"user": "jdoe",
"emailaddress": "johndoe@gmail.com",
"level": "Admin",
"location": "Other"
}

1 Reply

Avatar
tafutada777
are you okay disclose your token above?