Skip to content

feat: migrate from google sign in to google identity services

Navin Karkera requested to merge navin/migrate-google-auth into master

This MR migrates from google sign to google identity services by replacing react-google-login with @react-oauth/google in frontend and implementing custom route in backend to fetch access_token from google by exchanging auth_code.

Supporting information

Visual changes

Removed google-landing page, instead redirects to normal listaflow login page where Continue with google button will display loading circle while it completes the request. cc: @ali_hugo

https://www.loom.com/share/34ce903eef0d4f31a570c69040a731e0

Testing instructions

Step by step procedure

  1. Create google oauth client id credentials by following the steps mentioned here

Add urls as shown below:

image

  1. Download the credentials json (client id and secret) OR skip this and previous step and I can share the credentials for a test app.
  2. Checkout this MR and create env file :backend/.env
  3. Add the credentials json to env file as below:
GOOGLE_CREDENTIALS='{"web": {...}}'
  1. Add client_id to frontend/.env.local as REACT_APP_GOOGLE_CLIENT_ID=<value>
  2. Sign in using Continue with Google button.
  3. Delete your user from django admin
  4. Create your account again using Sign up form with same email as your google account (create some random username)
  5. Once the account is verified, sign out and use google sign in. It should log you into same account.
  6. Remove REACT_APP_GOOGLE_CLIENT_ID variable from frontend/.env.local and restart frontend. Verify that the sign in with google option is hidden.

Author notes and concerns

None or note it here

Merge request reports