Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do it in node.js and JWT 1) input JSON to the URL: http://localhost:3000/api/login with POST { username: test, password: 1234 } 2) Check whether the

Do it in node.js and JWT 1) input JSON to the URL: http://localhost:3000/api/login with POST

{

"username": "test",

"password": "1234"

}

2) Check whether the username and password are matched with "test" and "1234".

if they are matched then generate a TOKEN

{

"message": "Authenticated! Use this token in the \"Authorization\" header",

"token": "eyJhbG......jzdPzS8GI"

}

if they are not matched then show JSON with the message "Invalid Username or Password"

{

"message": "Invalid Username or Password",

"user": {

"username": "test",

"password": "134"

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago