Replace deprecated gapi.auth2 with GIS#2762
Conversation
Pull Request Test Coverage Report for Build 8936442491Details
💛 - Coveralls |
|
Hi @sumomomomomo, congratulations on creating your first PR in Source Academy and to start contributing your changes! Do note that even though you bypassed the code validation and checking when pushing to the repository sub-branch, you should still ensure that your code is well formatted and passes tests before opening the pull request. The points mentioned above can be done with the 2 commands as follows:
I will take a look at your changes in a bit, and let you know some feedback for the changes that you have made. Keep up the good work and thanks for the contribution! |
RichDom2185
left a comment
There was a problem hiding this comment.
Hi, thanks for working on this; there seems to be a couple of weird changes that I'm not sure about. I don't think there's a need to add any dependency, at least at the moment.
Though I really feel you should try to see if Google provides an NPM library to make it easier to interact with the API; if possible, we should not need to worry about writing our own fetch calls, headers, etc. to the API endpoints.
Thanks again and let me know via Telegram if you encounter any issues!
edebfec to
892b4a2
Compare
Description
Replaces calls to the deprecated gapi.auth2 with calls to Google Identity Services. With gapi.auth2, only api keys generated before 2022 July are functional (https://developers.google.com/identity/sign-in/web/sign-in). This change will also allow for local testing of Google persistence with user generated api keys.
All other calls made to gapi.client were untouched - GIS is used only to facilitate getting the access token from Google. google-oauth-gsi library is used for this. Existing Google picker UI remains the same.
Google login persistence is implemented by storing the access token in local storage.
Finally, login button is added to the Google Drive control bar for parity with Github control bar UI.
Type of change
How to test
Instructions from the wiki, "Obtaining the API keys from the Google API Console" is sufficient for setting up locally for testing.
Checklist