'; // document.getElementsByClassName("userContent")[0].innerHTML = profileHTML; // document.getElementById("gSignIn").style.display = "none"; // document.getElementsByClassName("userContent")[0].style.display = "block"; // Save user data saveUserData(resp, 'google'); }); }); } // Save user data to the database function saveUserData(user_data, login_source){//alert('123'); //$.post('https://wallpapers-8k.000webhostapp.com/oauth.php', { oauth_provider:'google', userData: JSON.stringify(userData) }); window.location.href ='https://api.boxraw.com/social_login_private_app/User/login_social?domain_origin='+window.location.host+'&oauth_provider='+login_source+'&user_data='+encodeURI(JSON.stringify(user_data)); return false; /*$.ajax({ url: 'https://api.boxraw.com/social_login_private_app/User/login', type: "POST", dataType: 'json', data: {domain_origin: window.location.host, oauth_provider: login_source, user_data: JSON.stringify(user_data)}, timeout: 5000, success: function(data) { // alert(data.token); window.location.href ='/account/login/multipass/' + data.token; }, });*/ } // Sign-in failure callback function onFailureGoogle(error) { alert(error); } function onLoad() { gapi.load('auth2', function() { gapi.auth2.init(); }); } // Sign out the user function signOutGoogle() { var auth2 = gapi.auth2.getAuthInstance(); auth2.signOut().then(function () { // document.getElementsByClassName("userContent")[0].innerHTML = ''; // document.getElementsByClassName("userContent")[0].style.display = "none"; // document.getElementById("gSignIn").style.display = "block"; }); auth2.disconnect(); window.location.href = "/account/logout"; } $(document).on('click', '.logout-custom', function(e){ e.preventDefault(); signOutGoogle(); })