https://github.com/jerrychong25/vue-vuex-jwt-auth
Vue Vuex JWT Auth
https://github.com/jerrychong25/vue-vuex-jwt-auth
jwt vue vue-jwt-authentication vue2 vuejs vuejs2 vuex
Last synced: 2 months ago
JSON representation
Vue Vuex JWT Auth
- Host: GitHub
- URL: https://github.com/jerrychong25/vue-vuex-jwt-auth
- Owner: jerrychong25
- Created: 2018-11-15T14:55:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T20:55:01.000Z (9 months ago)
- Last Synced: 2025-04-18T15:16:27.169Z (3 months ago)
- Topics: jwt, vue, vue-jwt-authentication, vue2, vuejs, vuejs2, vuex
- Language: Vue
- Homepage:
- Size: 2.86 MB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vue.js JWT Authentication with Vuex and Vue Router
[](https://gitHub.com/jerrychong25/vue-vuex-jwt-auth/releases/)
[](https://github.com/jerrychong25/vue-vuex-jwt-auth/graphs/commit-activity)
[](https://hits.seeyoufarm.com)## Note:
Open `src/services/auth-header.js` and modify `return` statement for appropriate back-end.```js
export default function authHeader() {
let user = JSON.parse(localStorage.getItem('user'));if (user && user.accessToken) {
return { Authorization: 'Bearer ' + user.accessToken }; // for Spring Boot back-end
// return { 'x-access-token': user.accessToken }; // for Node.js Express back-end
} else {
return {};
}
}
```## Project setup
```
npm install
```### Compiles and hot-reloads for development
```
npm run serve
```### Compiles and minifies for production
```
npm run build
```### Run your tests
```
npm run test
```### Lints and fixes files
```
npm run lint
```### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).