The Rails / JS-G + button only works after a page reload in some cases

I have a Rails application in which users can log in using Google Single Sign-On. I use gem omniauth-google-oauth2and One-time Code Flow (Hybrid Authentication). It works in some cases, but not in all. It always works when I do a sharp page / browser refresh.

I noticed that when I see this line in the Chrome JS console, it works:

Navigated to http://127.0.0.1:3000/signin 

If Navigated to [..]not displayed, it does not work. My suspicion is that he is doing something with turbo linksor with some other cache problem.

I tried the following to find out if this is related to turbo links, but this did not help:

# Coffeescript file
ready = -> 
  # Google logic and functions

$(document).ready(ready)

Any ideas on what might be causing this problem and how can I solve it?

+4
1

, . application.js //= require turbo links :

//= require jquery.turbolinks

//= require turbo links, , .

+2

Source: https://habr.com/ru/post/1598509/


All Articles