-
Notifications
You must be signed in to change notification settings - Fork 1
👽️ Migrate to Google Identity Services (#227) #233
base: develop
Are you sure you want to change the base?
Conversation
* Replace `node-sass` (incompatible with Apple Silicon architecture) with `sass`
* Replace existing Google log in button with new react-oauth/google sign-in button * TODO: update API/backend * TODO: implement Google logout
* Pins `psycopg2` to v2.8.6 to prevent `AssertionError: database connection isn't set to UTC` error which was causing `500` server errors on higher versions of the library with Django
* Force Node 16 in UI Dockerfile to avoid compatibility issues with Node 18
* Use new `@react-oauth/google` library for Google Sign-in * Create `GoogleLoginButton` component to mimic the previous Login button style
| openapi-codec==1.3.2 | ||
| pip-autoremove==0.9.0 | ||
| psycopg2>=2.8 | ||
| psycopg2==2.8.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Copyright 2020(c) The Ontario Institute for Cancer Research. All rights reserved. | ||
|
|
||
| FROM node AS prebuilder | ||
| FROM node:16 AS prebuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevents Docker from using Node 18+, as that breaks compatibility with this project. Node 16 appears to be the latest version of Node that will play nice with this.
| </Main> | ||
| </Switch> | ||
| </App> | ||
| <GoogleOAuthProvider clientId={clientId}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a lot, but I'm just wrapping the App in the GoogleOAuthProvider here. Necessary for the new Google auth library.
| @@ -0,0 +1,73 @@ | |||
| // adapted from: https://github.com/anthonyjgrove/react-google-login/blob/master/src/google-login.js | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to get the access_token required by our back-end, we have to use this library's "custom" button (the default, styled-out-of-the-box Login button does not return this token) which has no styles.
Rather than reinventing the wheel, I just adapted the button component the previous library was using. No one will suspect a thing ;)
@react-oauth/googlefor Google Login