Skip to content
  • Home
  • Entertainment
    • 4cgandhi
    • pakainfo
    • Sports
    • Make Money
    • Jobs
  • News
    • Insurance
      • Auto Car Insurance
      • Business Insurance
    • Donate
    • California
  • About Us
  • Contact Us
  • Privacy Policy
  • Site Map
  • Terms
Vuejs Facebook Login using PHP - vue facebook-login

Vuejs Facebook Login using PHP – vue facebook-login

February 15, 2019 by admin

Vuejs Facebook Login using PHP – vue facebook-login

In this Post We Will Explain About is Vuejs Facebook Login using PHP – vue facebook-login With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Login with facebook using vuejs- Demo and DownloadExample

In this post we will show you Best way to implement Simple Facebook Connect Vuejs Example Code Example, hear for Login System with Facebook with Vuejs and PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

READ :  Angular 6 Tutorial with Top 10 Examples

vue-authenticate is simple and setps easily configurable solution for Vue.js web-apps that all the provides local system and get some information login/registration as well as ther are Social login using Like as a Facebook authenticate, Google authenticate and Twitter authenticate OAuth providers.

index.html


  
    
    <title>vue-simple-facebook-login</title>
  
  
  <h1></h1>
    <div id="liveApp"></div>
  

template

<h1></h1>

  <div id="liveApp">
    <div class="">
      <button class="btn btn-primary">FB Logout</button>
      <button class="btn btn-primary">FB Login</button>

      <hr /><hr /><hr />

      <div class="">
        <img src="./assets/logo.png">
        
      </div>
    </div>

    <div class="">
      
        <img src="/static/shiba_walk.gif" alt="" width="500px" />
      
    </div>
  </div>

main.js

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

import Vue from 'vue'
import App from './App'

(function (d, s, id) {
  var myjs
  var firstjs = d.getElementsByTagName(s)[0]
  if (d.getElementById(id)) return
  myjs = d.createElement(s); myjs.id = id
  myjs.src = '//connect.facebook.net/en_US/sdk.js'
  firstjs.parentNode.insertBefore(myjs, firstjs)
}(document, 'script', 'facebook-jssdk'))

new Vue({
  el: '#liveApp',
  template: '',
  components: { App }
})

App.vue

import first-app from './components/first-app'
export default {
  name: 'liveApp',
  components: {
    first-app
  },
  data () {
    return {
      profile: {},
      phase_data: false,
      get_auth_data: false
    }
  },
  methods: {
    get_myprofile () {
      let vue_mount = this
      FB.api('/me', function (result_data) {
        alert(result_data)
        vue_mount.$set(vue_mount, 'profile', result_data)
      })
    },
    login () {
      let vue_mount = this
      FB.login(function (result_data) {
        vue_mount.statusChangeCallback(result_data)
      }, {scope: 'publish_actions'})
    },
    logout () {
      let vue_mount = this
      FB.logout(function (result_data) {
        vue_mount.statusChangeCallback(result_data)
      })
    },
    statusChangeCallback (result_data) {
      let vue_mount = this
      vue_mount.phase_data = true
      alert('statusChangeCallback')
      alert(result_data)
      if (result_data.status === 'connected') {
        vue_mount.get_auth_data = true
        vue_mount.get_myprofile()
      } else if (result_data.status === 'not_authorized') {
        vue_mount.get_auth_data = false
      } else {
        vue_mount.get_auth_data = false
      }
    }
  },
  mounted () {
    let vue_mount = this
    window.fbAsyncInit = () => {
      FB.init({
        appId: '1958478585556856',
        cookie: true,
        xfbml: true,
        version: 'v2.8'
      })
      FB.getLoginStatus(function (result_data) {
        vue_mount.statusChangeCallback(result_data)
      })
    }
  }
}

Style.css

.box {
  background-color: #3D2D3D;
  margin-bottom: 30px;
  padding: 30px;
  border-radius: 6px;
}
html, body {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #eee;
  background-color: #ddd;
  text-align: center;
  padding: 20px;
}


Example

READ :  Remove empty null values from json object in jquery

I hope you have Got What is vuejs facebook login – Login with Facebook using Vuejs And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Categories Laravel, MySQL, PHP, Technology, VueJs Tags facebook use vuejs, facebook-login-vuejs, vue auth google, vue js google login, vue-facebook-signin-button, vue.js social login, vuejs google login, vuejs social login Leave a comment
Post navigation
VueJs Autocomplete using Laravel Example
AngularJS Multiple Images uploading using PHP
  • whatismyscreenresolution
  • tamilrockers new link 2019 free download
  • tamilrockers website link
  • tamilrockers new link 2019
  • tamilrockers url
© 2021 InfinityKnow • Powered by GeneratePress
Scroll back to top
↞
↠