Skip to content
Branch: master
Find file History
bahmutov Clean up readme - remove duplicate feature lists (#299)
* move first list

* more lists

* more examples moved

* move more

* more examples

* update all blog recipes

* add two items

* move unit testing readme

* even lists moved

* more work

* more moved
Latest commit e509f00 Jun 12, 2019

README.md

logging-in__jwt

Example of logging in using JWT

  • Test login UI form
  • Use cy.request() once to get user object and JWT
  • Before each test set the JWT and the user object in localStorage before visiting the page
  • The opened page instantly has the user logged in

Server

Copied from https://jasonwatmore.com/post/2018/08/06/nodejs-jwt-authentication-tutorial-with-example-api

npm run start:server

Runs the API at port 4000

Front-end

Vue application copied from https://jasonwatmore.com/post/2018/07/06/vue-vuex-jwt-authentication-tutorial-example

npm run start:app

Runs the web application at port 8081

The front-end SPA logs in and stores the JWT and user information in the localStorage item named user

JWT token

All Ajax requests to the protected resources need to have Authorization header with the Beater <token> value.

Authenticated Ajax call

Tests

You can’t perform that action at this time.