PHP Classes

File: js/code/valida.js

Recommend this page to a friend!
  Classes of António Lira Fernandes   PHP Google Login   js/code/valida.js   Download  
File: js/code/valida.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Google Login
Authenticate site users with Google accounts
Author: By
Last change:
Date: 3 years ago
Size: 1,643 bytes
 

Contents

Class file image Download
const _SERVIDORaut= window.location.protocol + "//" + window.location.host + "/"; //console.log(_SERVIDORaut) //####################################### Autenticação ###################################################### const verificaAutentica = async () => { //console.log("ver"); //alert("ddd"); const response = await fetch(_SERVIDORaut +`public/autenticacao/getAutentication`) const lv = await response.json() for (const v of lv) { if (v.user!== null){ //document.getElementById("photo").setAttribute("src", v.foto) //document.getElementById("name").innerHTML =v.nome }else{ window.location.href = "/error.html"; } } } const renderAutentica = async () => { //console.log("ver"); const response = await fetch(_SERVIDORaut +`public/autenticacao/getAutentication`) const lv = await response.json() for (const v of lv) { if (v.user!== null){ document.getElementById("photo").setAttribute("src", v.foto) document.getElementById("name").innerHTML =v.nome }else{ window.location.href = "error"; } } } //####################################### Autenticação ###################################################### function logout(){ $.get( _SERVIDORaut +`public/autenticacao/logout`, function( data ) { window.location.href = "/notlogged.html"; //$( ".result" ).html( data ); //alert( "Load was performed." ); }); } function signOut() { var auth2 = gapi.auth2.getAuthInstance(); auth2.signOut().then(function () { console.log('User signed out.'); }); gapi.auth2.getAuthInstance().disconnect(); }