generated from cremalab/app-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Adasp 33 oauth #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RubySpeeders
wants to merge
56
commits into
develop
Choose a base branch
from
ADASP-33-oauth
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adasp 33 oauth #11
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
fe87f5f
ADASP-33: adding google api script tag
RubySpeeders f1059e9
ADASP-33: creating new component
RubySpeeders 16df00e
ADASP-33: in the middle of an error, Googleauth gomponent not quite rβ¦
RubySpeeders ddc3d5b
ADASP-33: adding ts deps for gapi. writing useeffect to get the gapi β¦
RubySpeeders 611cb57
ADASP-33: adding a listen function for if user signs in or not
RubySpeeders 869f59e
ADASP-33: configuring a rtk slice for whether or not a user is signed in
RubySpeeders a44a5e7
ADASP-33: adding a signout reducer
RubySpeeders 0ede644
ADASP-33: merging develop into this branch
RubySpeeders 8b94e08
ADASP-33: hooked up rtk to hold isSignedIn, clicking the button signsβ¦
RubySpeeders 12e3b11
ADASP-33: added userId to be recorded on state
RubySpeeders dca18b7
ADASP-33: adding drawer component to show/hide sign in/out button. adβ¦
RubySpeeders 91c6721
ADASP-33: adding in a dummy test in GoogleAuth
RubySpeeders 891d85c
ADASP-33: adding dummy test to Drawer
RubySpeeders 13ecd4f
ADASP-33: adding Provider tag to all tests
RubySpeeders 9e1e1eb
ADASP-33: adding closing the drawer when signin/out button is clicked
RubySpeeders c25c7a2
ADASP-33: adding testing for oauth rtk
RubySpeeders f70d412
ADASP-33: adding a test in appheader to check if clicking on hamburgeβ¦
RubySpeeders de0295b
ADASP-33: deleted some keystrokes
RubySpeeders a81406b
ADASP-33: adding a test to drawerSlice to check that the drawer stateβ¦
RubySpeeders 55261a0
ADASP-33: hiding GoogleAuth from tests for now
RubySpeeders 21096c8
ADASP-33: creating a type for initialstate to account for null
RubySpeeders 270f290
ADASP-33: adding a render option for is isSignedIn is null
RubySpeeders 038a053
ADASP-33: changing the render of null state of google oauth to be theβ¦
RubySpeeders e3398b4
ADASP-33: adjusting custom type for sliceState for oauth
RubySpeeders 0219e34
ADASP-33: miscellaneous resolving requested changes from PR
RubySpeeders 2cba37e
ADASP-33: changes from github PR comments
RubySpeeders 2e1d2be
ADASP-33: adding a custom hook for google auth, and downloading googlβ¦
RubySpeeders c97bc6f
ADASP-33: adding function in googleauth to call to api, probably needβ¦
RubySpeeders 7c957c0
ADASP-33: some changes from last week (oh no) changing naming conventβ¦
RubySpeeders e5f980c
ADASP-33: adding dotenv package and a new component to test google loβ¦
RubySpeeders 8212e49
ADASP-33: changing the name of google logins to login only, adding thβ¦
RubySpeeders 45120ce
ADASP-33: keystrokes?
RubySpeeders ce68283
ADASP-33: adding some styling to drawer
RubySpeeders 86b247c
ADASP-33: adding correct prefix for env variable
RubySpeeders 500c6d4
ADASP-33: adding Logout button and component
RubySpeeders fc45c71
ADASP-33: adding dispatch to toggle drawer closed after logging in. aβ¦
RubySpeeders 6f1fff1
ADASP-33: adding logout todo
RubySpeeders c963c0a
ADASP-33: adding toggle drawer to close drawer after logging out
RubySpeeders 5fe9d56
ADASP-33: updating tests
RubySpeeders 459aff6
ADASP-33: updating tests
RubySpeeders a3e1d20
ADASP-33: updating tests
RubySpeeders 732970e
ADASP-33: adding custom command for testing google oauth
RubySpeeders 6a2f27b
merge conflicts
RubySpeeders d7aef22
ADASP-33: actually saving
RubySpeeders d1102f3
ADASP-33: ran npm i
RubySpeeders 935a3f8
ADASP-33: changing file structure for custom commands.
RubySpeeders f2060cb
ADASP-33: adding variables to plugin file for cypress
RubySpeeders 21ec88c
ADASP-33: changing the variables back to use .env variables
RubySpeeders b86707e
ADASP-33: adding a cypress custom command
RubySpeeders 65b8dd1
ADASP-33: adding intercept Google cypress command
RubySpeeders 7f4403d
ADASP-33: custom createTask Cypress task. adding in a check in App.jsβ¦
RubySpeeders 9051a5f
ADASP-33: adding another value to state for username so I can render β¦
RubySpeeders 19fb255
ADASP-33: updating test to match getting username now, as well
RubySpeeders 8f04c4f
ADASP-33: adding a few more tests
RubySpeeders a4b3a65
ADASP-33: tests - i'm not sure. it's been a few days
RubySpeeders 496e1c9
ADASP-33: deleting file with secret key
RubySpeeders File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import "@testing-library/cypress/add-commands" | ||
|
|
||
| Cypress.Commands.add("createTask", () => { | ||
| cy.findByText("Create New Task").click() | ||
| cy.get("#taskInput").type("make dinner") | ||
| cy.findByText("Save").click() | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import "@testing-library/cypress/add-commands" | ||
|
|
||
| Cypress.Commands.add("loginByGoogleApi", () => { | ||
| cy.log("Logging in to Google") | ||
| cy.request({ | ||
| method: "POST", | ||
| url: "https://www.googleapis.com/oauth2/v4/token", | ||
| body: { | ||
| grant_type: "refresh_token", | ||
| client_id: Cypress.env("googleClientId"), | ||
| client_secret: Cypress.env("googleClientSecret"), | ||
| refresh_token: Cypress.env("googleRefreshToken"), | ||
| }, | ||
| }).then(({ body }) => { | ||
| const { access_token, id_token } = body | ||
|
|
||
| cy.request({ | ||
| method: "GET", | ||
| url: "https://www.googleapis.com/oauth2/v3/userinfo", | ||
| headers: { Authorization: `Bearer ${access_token}` }, | ||
| }).then(({ body }) => { | ||
| cy.log(body) | ||
| const userItem = { | ||
| token: id_token, | ||
| user: { | ||
| googleId: body.sub, | ||
| email: body.email, | ||
| givenName: body.given_name, | ||
| familyName: body.family_name, | ||
| imageUrl: body.picture, | ||
| }, | ||
| } | ||
|
|
||
| window.localStorage.setItem("googleCypress", JSON.stringify(userItem)) | ||
| cy.visit("/todo") | ||
| }) | ||
| }) | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
| /* eslint-disable @typescript-eslint/no-namespace */ | ||
| // *********************************************************** | ||
| // This example support/index.js is processed and | ||
| // loaded automatically before your test files. | ||
| // | ||
| // This is a great place to put global configuration and | ||
| // behavior that modifies Cypress. | ||
| // | ||
| // You can change the location of this file or turn off | ||
| // automatically serving support files with the | ||
| // 'supportFile' configuration option. | ||
| // | ||
| // You can read more here: | ||
| // https://on.cypress.io/configuration | ||
| // *********************************************************** | ||
|
|
||
| // Import commands.js using ES2015 syntax: | ||
| import "./googleLogin" | ||
| import "./createTask" | ||
| import "@testing-library/cypress/add-commands" | ||
|
|
||
| declare global { | ||
| namespace Cypress { | ||
| interface Chainable { | ||
| /** | ||
| * Custom command to select DOM element by data-cy attribute. | ||
| * @example cy.loginByGoogleApi() | ||
| */ | ||
| loginByGoogleApi(): Chainable<Window> | ||
| createTask(): Chainable<Window> | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,5 @@ | |
| }, | ||
| "include": [ | ||
| "**/*.ts" | ||
| ] | ||
| ], | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@RubySpeeders I think that we need to add these variables to the GitHub repo settings in order to successfully authenticate. This would be the information you have in your
.envfile I believe.