vue-aspnet-auth

Vue plugin for auth to OWIN MVC
877
Install
npm install vue-aspnet-auth
Latest Version:1.5.4
Vue:2
License:MIT
Last Updated:Dec 6, 2022
Links: GitHub  ·  npm
Maintainer: halceyon

vue-aspnet-auth

GitHub license Build Status codecov npm Greenkeeper badge semantic-release

A Vue plugin wrapper for aspnet-auth.

Getting Started

Install

From npm

npm install vue-aspnet-auth --save

Usage

Import and initialize the plugin.

import { AspnetAuth } from 'vue-aspnet-auth';

Vue.use(AspnetAuth, {
  url: 'http://localhost:46993',
});

Basic login example:

export default {
  name: 'login',
  data() {
    return {
      username: '',
      password: '',
    };
  },
  methods: {
    login() {
      this.$auth.login(this.username, this.password, (data) => {
        if (data.result) {
          this.$store.commit('auth', this.$auth.authentication);
          this.$root.$emit('app.loggedin');
        } else {
          this.error = data.message;
        }
      });
    },
  },
  created() {
	// initialize url
    this.$auth.url = `http://localhost:1234`;
  },
};

License

Copyright © 2018 Code HQ (Pty) Ltd. This source code is licensed under the MIT license found in the LICENSE file.


Made with ♥ by Craig Pretorius

Related Packages

@enso-ui/auth

Authentication pages, auth store helpers, and password-strength utilities for En...

11,552 0
vue-firebase

Vue Firebase

1,691 2
vue-adal

Vue plugin for using Azure Active Directory

16,922 105

Version History

Version Released Vue License
1.5.4 ^2.5.13 MIT
1.5.3 ^2.5.13 MIT
1.5.2 ^2.5.13 MIT
1.5.1 ^2.5.13 MIT
1.5.0 ^2.5.13 MIT
Pre-releases (2)
Version Released License
1.2.0-development MIT
0.0.0-development MIT