Vue CLI plugin for Authentication
$ vue add auth
This will create a src/auth.js
file which you can use in your Vue component script as following:
import auth from './auth';
export default {
data() {
return {
auth
}
}
}
and then you can use auth.authenticated
to check whether the user is authorized or not.
You can also use auth.login()
and auth.logout()
to do the described actions.
<a @click="auth.login()" href="#" v-show="!auth.authenticated">Login</a>
<a @click="auth.logout()" href="#" v-show="auth.authenticated">Logout</a>
Here is a list of Contributors
I accept pull requests and guarantee a reply back within a day
MIT/X11
Report here. Guaranteed reply within a day.
Pavan Kumar Sunkara (pavan.sss1991@gmail.com)