|
1 |
| -# vue-3-jwt-refresh-token |
| 1 | +# Vue 3 JWT Refresh Token with Axios example |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +For instruction, please visit: |
| 6 | +> [Vue 3 JWT Refresh Token with Axios example](https://bezkoder.com/vue-3-refresh-token/) |
| 7 | +
|
| 8 | +> [Vue 3 Authentication & Authorization with JWT, Vuex and Vue Router](https://bezkoder.com/vue-3-authentication-jwt/) |
| 9 | +
|
| 10 | +## Note: |
| 11 | +Open `src/services/setupInterceptors.js` and modify `config.headers` for appropriate back-end (found in the tutorial). |
| 12 | + |
| 13 | +```js |
| 14 | +instance.interceptors.request.use( |
| 15 | + (config) => { |
| 16 | + const token = TokenService.getLocalAccessToken(); |
| 17 | + if (token) { |
| 18 | + // config.headers["Authorization"] = 'Bearer ' + token; // for Spring Boot back-end |
| 19 | + config.headers["x-access-token"] = token; // for Node.js Express back-end |
| 20 | + } |
| 21 | + return config; |
| 22 | + }, |
| 23 | + (error) => { |
| 24 | + return Promise.reject(error); |
| 25 | + } |
| 26 | +); |
| 27 | +``` |
| 28 | + |
| 29 | +Related Posts: |
| 30 | +> [Vue 2 JWT Authentication with Vuex and Vue Router](https://bezkoder.com/jwt-vue-vuex-authentication/) |
| 31 | +
|
| 32 | +> [Using Typescript](https://bezkoder.com/vuex-typescript-jwt-auth/) |
| 33 | +
|
| 34 | +> [Vue 3 CRUD example with Axios and Vue Router](https://bezkoder.com/vue-3-crud/) |
| 35 | +
|
| 36 | +Fullstack with Spring Boot Back-end: |
| 37 | +> [Spring Boot + Vue.js: Authentication with JWT & Spring Security Example](https://bezkoder.com/spring-boot-vue-js-authentication-jwt-spring-security/) |
| 38 | +
|
| 39 | +Fullstack with Node.js Express Back-end: |
| 40 | +> [Node.js Express + Vue.js: JWT Authentication & Authorization example](https://bezkoder.com/node-express-vue-jwt-auth/) |
| 41 | +
|
| 42 | +Fullstack CRUD: |
| 43 | +> [Vue.js + Node.js + Express + MySQL example](https://bezkoder.com/vue-js-node-js-express-mysql-crud-example/) |
| 44 | +
|
| 45 | +> [Vue.js + Node.js + Express + PostgreSQL example](https://bezkoder.com/vue-node-express-postgresql/) |
| 46 | +
|
| 47 | +> [Vue.js + Node.js + Express + MongoDB example](https://bezkoder.com/vue-node-express-mongodb-mevn-crud/) |
| 48 | +
|
| 49 | +> [Vue.js + Spring Boot + MySQL/PostgreSQL example](https://bezkoder.com/spring-boot-vue-js-crud-example/) |
| 50 | +
|
| 51 | +> [Vue.js + Spring Boot + MongoDB example](https://bezkoder.com/spring-boot-vue-mongodb/) |
| 52 | +
|
| 53 | +> [Vue.js + Django example](https://bezkoder.com/django-vue-js-rest-framework/) |
| 54 | +
|
| 55 | +Integration (run on same server/port): |
| 56 | +> [Integrate Vue.js with Spring Boot](https://bezkoder.com/integrate-vue-spring-boot/) |
| 57 | +
|
| 58 | +> [Integrate Vue App with Node.js Express](https://bezkoder.com/serve-vue-app-express/) |
| 59 | +
|
2 | 60 |
|
3 | 61 | ## Project setup
|
4 | 62 | ```
|
|
0 commit comments