Chapter 13

Answer 1: You have to create a new component that renders input fields for the username and the password. The component contains also a button that calls /login endpoint when the button is pressed.

Answer 2The call from the login component is made using the POST method and an user object is embedded in the body. If the authentication is succeeded, the backend sends the token back in the Authorization header.

Answer 3: The token can be saved to session storage using the sessionStorage.setItem() method.

Answer 4: The token have to be included to the request's Authorization header.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.96.94