0.2.2 • Published 9 years ago

vueui-firebase-auth v0.2.2

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

vueui-firebase-auth

The easiest way to setup Firebase authentication if you are using Vue.js and Semantic-UI.

vueui-firebase-auth

Usage

First install the npm package: npm i -S vueui-firebase-auth

Then import it into your project:

var Vue = require('vue')
var firebaseAuth = require('vueui-firebase-auth');

Vue.use(firebaseAuth)

That will register three components globally: ui-auth, ui-login, ui-signup. You will be using ui-auth, unless you need to customize the UI, etc.

You now have two ways to consume the component:

<ui-auth
    firebase="your-firebase-app"
    facebook='email'
    google='email'
    github='user, gist'
    twitter></ui-auth>

OR

var Auth = Vue.component('ui-auth'); // Retrieve the ui-auth component constructor

var auth = new Auth({
    el: '#some-id',
    data: {
        firebase: 'your-firebase-app',
        providers: [ 'facebook', 'google', 'github' ],
        scopes: {
            facebook: 'email, user_likes',
            google: 'email',
            github: 'user, gist'
        }
    }
})

That's it!

API

A $user property is attached to $root and it has the following methods:

.signup(user|Object)

.login(user|Object)

.logout()

.authWithProvider(provider|String, scope|String)

Events

Two events are emitted on $root when a user is authenticated: user:loggedIn which receives the user data as an argument, and user:loggedOut

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago