feat: migrate from google sign in to google identity services
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
- Jira ticket: BB-6744
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
- Create google oauth client id credentials by following the steps mentioned here
Add urls as shown below:
- Download the credentials json (client id and secret) OR skip this and previous step and I can share the credentials for a test app.
- Checkout this MR and create env file :
backend/.env
- Add the credentials json to env file as below:
GOOGLE_CREDENTIALS='{"web": {...}}'
- Add client_id to
frontend/.env.local
asREACT_APP_GOOGLE_CLIENT_ID=<value>
- Sign in using
Continue with Google
button. - Delete your user from django admin
- Create your account again using
Sign up
form with same email as your google account (create some random username) - Once the account is verified, sign out and use google sign in. It should log you into same account.
- Remove
REACT_APP_GOOGLE_CLIENT_ID
variable fromfrontend/.env.local
and restart frontend. Verify that the sign in with google option is hidden.
Author notes and concerns
None or note it here