0.0.8 • Published 7 years ago

@kailight/socials v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Documentation

import Socials from '@kailight/socials'
let options = {
  // tribefire-auth server to point popup to 
  base : 'http://localhost:3000',
  // dispatch this vuex action when login happens
  onLogin : 'onSocialLogin',
  // this route is automatically added to router and is used for callback
  cb : '/auth-callback'
  // since we use client-side auth, Facebook clientId is required
  Facebook : { clientId : 'some numbers' } 
}
Vue.use( Socials, options )
// In your store add mutation
onSocialLogin: (context, data) => {
  info('setUserData()', data)
  context.commit('setUserData', data)
}
// that will call following action
onSocialLogin: (state, data) => {
  info('setUserData', data)
    if (data.social) {
      state.User[data.social] = data.data
    }
  }
}

Then, in your component

this.$Socials.login('Twitter')

Note that this code only works in conjuction with backend, property of Tribefire

See github

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago