Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 14 hours 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 (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T23:55:40.000Z (24 days ago)
- Last Synced: 2024-09-10T03:55:00.052Z (23 days ago)
- Topics: jwt, vue, vue-jwt-authentication, vue2, vuejs, vuejs2, vuex
- Language: Vue
- Homepage:
- Size: 2.51 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vue.js JWT Authentication with Vuex and Vue Router
[![GitHub release](https://img.shields.io/github/release/jerrychong25/vue-vuex-jwt-auth.svg)](https://gitHub.com/jerrychong25/vue-vuex-jwt-auth/releases/)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-no-red.svg)](https://github.com/jerrychong25/vue-vuex-jwt-auth/graphs/commit-activity)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fjerrychong25%2Fvue-vuex-jwt-auth&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](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/).