The in memory refresh token demonstrates one way to refresh your access token using Axios interceptors and an Express server. This also includes unit test using Vue test utils.
Vue 3 composition api, Formkit, Typescript, Tailwind, Express for the backend, Vue test utils for unit tests
For detailed explanation on the tech stack check below:
- Vue 3, check out the documentation.
- Vite, check out the documentation.
- Formkit, check out the documentation.
- Tailwind, check out the documentation.
- Typescript, check out the documentation.
- Vue test utils, check out the documentation.
- Express, check out the documentation.
Please note rename the .env.example to .env Inside the .env file you will see this VITE_API_URL ='' enter the server url in between the single quotes this will allow the app to work with the server. To build this app I used an express server by Dave Gray see all his great work here: https://github.com/gitdagray. And to use the same server I used by Dave Gray you can find it here: https://github.com/gitdagray/express_jwt. It send a JWT using HTTP cookies and stores your users. There is also a employee endpoint which i use to test if the access token has expired so I can see it in dev tools. When you click the get employees button you will see the value in the dev tools console tab. But you can adapt it to use any backend you want.
# install dependencies
$ npm install
# serve your server mine was at localhost:3500 do this before starting the app or it will not work. Yours may be different
$ npm run start
# serve with hot reload at localhost:5173
$ npm run dev
# build for production and launch server
$ npm run build