File: resources/config/accountkit.js

Recommend this page to a friend!
  Classes of adeniyi ibraheem  >  Laravel Account Kit  >  resources/config/accountkit.js  >  Download  
File: resources/config/accountkit.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Account Kit
Authenticate users with Facebook accounts
Author: By
Last change:
Date: 3 years ago
Size: 1,194 bytes
 

Contents

Class file image Download
AccountKit_OnInteractive = function() {
  AccountKit.init({
    appId: 'XXXXXXXXXXXXX',
    state: document.getElementById('_token').value,
    version: 'v1.0'
  });
};

function loginCallback(response) {
  console.log(response);

  if (response.status === "PARTIALLY_AUTHENTICATED") {
    document.getElementById('code').value = response.code;
    document.getElementById('_token').value = response.state;
    document.getElementById('form').submit();
  }

  else if (response.status === "NOT_AUTHENTICATED") {
      // handle authentication failure
      alert('You are not Authenticated');
  }
  else if (response.status === "BAD_PARAMS") {
    // handle bad parameters
    alert('wrong inputs');
  }
}

// phone form submission handler
function smsLogin() {
  var countryCode = document.getElementById('country').value;
  var phoneNumber = document.getElementById('phone').value;
  AccountKit.login(
    'PHONE',
    {countryCode: countryCode, phoneNumber: phoneNumber},
    loginCallback
  );
}
// email form submission handler
function emailLogin() {
  var emailAddress = document.getElementById("email").value;
  AccountKit.login('EMAIL', {emailAddress: emailAddress}, loginCallback);
}

For more information send a message to info at phpclasses dot org.