Проблема перезагрузки страницы с бесконечным временем - PullRequest
0 голосов
/ 09 июня 2019

Я использую Google OAuth, используя JavaScript и PHP, когда пользователи успешно входят в систему, страница загружается бесконечно долго.

<script>
  function onSignIn(googleUser) { 

    var profile = googleUser.getBasicProfile(); 
    var id= profile.getId(); 
    var name=profile.getName(); 
    var image=profile.getImageUrl(); 
    var email=profile.getEmail();
    var id_token = googleUser.getAuthResponse().id_token;

    $.ajax({
     url:'google-login',
     method:'post',
     data:{name,image,email,id,id_token},
     }).done(function() {
      window.location.reload();
     });

  }

<script>

Я хочу, когда пользователь успешно регистрируется / входит в систему с помощью страницы Google OAuth API..

1 Ответ

0 голосов
/ 09 июня 2019
    $.ajax({
    url:'google-login',
    method:'post',
    data:{name, image, email, id, id_token},
    success: function(data) {
       if (data.success == true) 
            setTimeout(function(){ 
             window.location.reload(); 
             }, 5000);
            }               
   });
...