I'm having trouble connecting my Devise Token Auth with a token I get back from google in react.
I'm using this package for the button: https://www.npmjs.com/package/react-google-login
This is the auth I'm trying to set up: https://github.com/lynndylanhurley/devise_token_auth/blob/master/docs/config/omniauth.md
I'm getting a response from google with the react button but I have no idea how that information has to translate to go back to the devise auth.
Information online is severely lacking between these 2 technologies. What it comes down to is how to translate this ruby tag into react:
<%= link_to "Sign in with Google", user_google_oauth2_omniauth_authorize_path, method: :post %>
I know this is old but here are my 2 cents.
I have used this gem OmniAuth Google OAuth2. The information is pretty clear. In my project, I manage my token using JWT while still storing the access and refresh tokens from Google.
Backend
Above routes translations
Here is the front end
Do not worry about defining the
gapifunction, it is loadedscriptin the aboveA few resources to help Google Sign-In JavaScript client reference, How to integrate Google API into your React app and that's it.