tb-vue-facebook-login
v1.0.5
Published
A Vue facebook-login-plugin
Downloads
10
Maintainers
Readme
Vue facebook login plugin
Usage
Install in your VueJS project:
npm i -s tb-vue-facebook-login
Import in main.js and install:
import FacebookLoginPlugin from 'tb-vue-facebook-login'
Vue.use(FacebookLoginPlugin, { login: "http://your-website.com/api/login" })
// /login will receive { "token": "ejysdfusdh.alfjsdk.sdfsdfds" }
A global facebook-login-component tag will be installed.
Add the following tag to your index.html:
<meta name="facebook-signin-app_id" content="yourappid">
Use facebook-login-component in any component you wish:
<template>
<div id="auth-popup">
<facebook-login-component
@loginSuccess="loginSuccessHandler">
</facebook-login-component>
</div>
</template>
And you are good to go!
Emitted events and props:
<template>
<div id="auth-popup">
<facebook-login-component
@loginSuccess="methodCalledWhenLoginIsCompletedOnYourSite"
@authSuccess="methodCalledWhenFacebookAuthTokenArrived"
@loginFail="methodCalledWhenLoginFailedOnYourSite"
@authFail="methodCalledWhenFacebookAuthFailed">
</facebook-login-component>
</div>
</template>