All Projects → joostlawerman → vue-token

joostlawerman / vue-token

Licence: MIT license
Simple token storage/ authorization in vuejs.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-token

EasyTokenGenerator
This repo aims to dynamically and simply generate tokens in Token Based systems.
Stars: ✭ 15 (+15.38%)
Mutual labels:  jwt-token, token
phalcon-micro-rest-api-skeleton
This is a basic API REST skeleton written on Phalcon PHP. Great For building an MVP for your frontend app (Vue, react, angular, or anything that can consume an API)
Stars: ✭ 57 (+338.46%)
Mutual labels:  jwt-token, token
tongyimall
高仿小米商城用户端,是Vue + SpringBoot的前后端分离项目,包括首页门户、商品分类、首页轮播、商品展示、购物车、地址管理等部分。管理端在另一个仓库。
Stars: ✭ 55 (+323.08%)
Mutual labels:  jwt-token, token
Jwtpermission
基于token验证的Java Web权限控制框架,使用jjwt,支持redis和db多种存储方式,可用于前后端分离项目,功能完善、使用简单、易于扩展。
Stars: ✭ 186 (+1330.77%)
Mutual labels:  jwt-token, token
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (+30.77%)
Mutual labels:  jwt-token
tokenstealer
No description or website provided.
Stars: ✭ 16 (+23.08%)
Mutual labels:  token
snapdragon-lexer
Converts a string into an array of tokens, with useful methods for looking ahead and behind, capturing, matching, et cetera.
Stars: ✭ 19 (+46.15%)
Mutual labels:  token
ethereum-crowdsale
0xcert protocol crowdsale contracts for Ethereum blockchain.
Stars: ✭ 15 (+15.38%)
Mutual labels:  token
node-mysql
Node with mysql boilerplate
Stars: ✭ 72 (+453.85%)
Mutual labels:  jwt-token
token-authentication-django
This is django app used to explain the tutorial present on https://medium.com/@shubhambansal_89125/token-based-authentication-for-django-rest-framework-44586a9a56fb
Stars: ✭ 27 (+107.69%)
Mutual labels:  token
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (+538.46%)
Mutual labels:  token
spring-boot-login-example
Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example
Stars: ✭ 50 (+284.62%)
Mutual labels:  jwt-token
cognito-jwt-verifier
Verify ID and access JWT tokens from AWS Cognito in your node/Lambda backend with minimal dependencies.
Stars: ✭ 25 (+92.31%)
Mutual labels:  token
xm-spring-boot
Spring Boot 基础项目
Stars: ✭ 33 (+153.85%)
Mutual labels:  token
Auth-using-Vuejs-express-jwt-nodejs
Login and signup form and authentication using Vue.js, express, mongodb, JWT and bootstrap-vue
Stars: ✭ 17 (+30.77%)
Mutual labels:  jwt-token
React-Express-JWT-UserPortal
React.js & Express.js User portal Using Core UI, JWT, JWT Token, Refresh Token, Role & Permission management, User manamgenet, Event Log.
Stars: ✭ 22 (+69.23%)
Mutual labels:  jwt-token
express-mongo-jwt-boilerplate
Express Mongo JsonWebToken boilerplate
Stars: ✭ 100 (+669.23%)
Mutual labels:  jwt-token
conduit
Conduit - Open Source 0x Relayer API implemented in NodeJS
Stars: ✭ 18 (+38.46%)
Mutual labels:  token
springboot-graphql-sqqr-jwt-demo
GraphQL java backend representing the right way to authenticate/authorize using Spring boot, graphql-spqr & jsonwebtoken
Stars: ✭ 28 (+115.38%)
Mutual labels:  jwt-token
Key-Checker
Go scripts for checking API key / access token validity
Stars: ✭ 190 (+1361.54%)
Mutual labels:  token

Vue-Token

Simple token storage/ authorization in vuejs.

This plugin requires you to initialize the vue-resource plugin first.

The token will be stored into the Authorization header with each request you make with the vue-resource plugin.

npm install vue-token --save

Usage

import Auth from "vue-token";
Vue.use(Auth, options);

Options

{
	loginUrl: "/api/login", 
	signupUrl: "/api/users", 
	logoutUrl: "/api/logout",
	refresh: false // Utilize the automatic refresh of tokens (it will use the token from response.token as the new token)
}

Example Component

<script>
export default {
	data(){
		return {
			input: {
				email: "",
				password: ""
			}
		}
	},
	created(){
		//
	},
	methods: {
		send() {
        	this.$auth.login(this, this.input, "profile/0", (errors) => {
				console.log(errors);
        	});
        }
	}
}
</script>

Methods

$auth.
	// Send a (post) request to the loginUrl.
	login(context, input, redirect = false, errorHandler = false)
		
	// Send a (post) request to the signupUrl.
	register(context, input, redirect = false, errorHandler = false login = true)
		
	//Send a (get) request to the logoutUrl.
	logout(context, redirect = false, errorHandler = false)
		
	//Check if a token is being stored and if is not null.
	check()
		
	//Get the token from the localStorage.
	getToken()
		
	//Set a token in the localStorage.
	setToken(token)
		
	//Remove the token from the localStorage.
	removeToken()

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].