title: Google SPA oauth + JWT + Rails
body: <p>I have Rails 5 app. As for the frontend we use Vue js. So it is closed app for only authorised google users. How it works now:</p>
  
  <p>Vue calls Google and authenticates user, after that it send the payload to rails server. I use google-oauth gem, so I can see token, expiration date, id_token as well as refresh_token for the first time. I check against my database if we do have same user by it's email as google provided. And if yes I create a JWT token that I send back to frontend with expiration date for 1 day. The token is saved in cookies.</p>
  
  <p>Every time API call is made to backend the jwt token is provided and I check again against user if it still exist on my database. </p>
  
  <p>The problem is that is not a good UX for users to log in everyday again and again. I would like to refresh user, but I do not save any tokens from google in my db. Should I use that?</p>
  
  <p>Do I need to do additional calls to google from server side maybe?</p>
  
  <p>Did anyone implemented anything on their projects like this? How does sign in authentication works with google and do I need to do calls to google everytime?</p>
  
  <p>I don't have Redis on my server as it is not possible to get it installed, so I can't use jwt sessions gem.</p>