-
Notifications
You must be signed in to change notification settings - Fork 4
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
DCJ-649: Use OidcBroker for sign-out functionality #2657
Conversation
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 good, thanks for adding some tests 👍
# Conflicts: # src/App.jsx # src/components/DuosHeader.jsx
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.
This looks reasonable - I am curious how it works with sign in using previous auth, but sign out using oidc? Presumably its backwards compatible because Google Auth is included within OIDC?
path: cypress/screenshots | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | ||
- uses: actions/upload-artifact@v4 | ||
with: |
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.
Should this also have if: failure()
?
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.
Yes, nice catch!
}); | ||
await Auth.initialize(); | ||
}); | ||
it('Sign Out Clears the session when called', async function () { |
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.
Do you store anything in localStorage on DUOS? That might also be good to check if so.
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.
We do - I'll boost the uses of Storage.setXYZ()
and check those too, thank you!
|
||
const text = 'TOS Text'; | ||
const mocks = { | ||
history: { push() {} } | ||
history: { |
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.
Nit: Is this a lint change? I personally find it more readable the other way.
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.
Yes, that's it exactly - I manually unformatted it, then ran our eslint checks and it made the same change.
await Storage.clearStorage(); | ||
await setIsLoggedIn(false); | ||
}; | ||
|
||
const signIn = async () => { |
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.
This will move to OIDC with https://broadworkbench.atlassian.net/browse/DCJ-654, correct?
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.
Correct. I'm trying to de-tangle the sign-in code here so it's less of a boil-the-ocean change.
Both sign-in and sign-out are fully functional. Sign-in is the bigger lift so I'm working on that now, but separately. The sign-out exercises both the old way of clearing local storage as well as triggering the OIDC library sign-out functionality. |
Addresses
https://broadworkbench.atlassian.net/browse/DCJ-649
auth.ts
: https://broadworkbench.atlassian.net/browse/DCJ-328oidcBroker.ts
: https://broadworkbench.atlassian.net/browse/DCJ-330Summary
auth.ts
is a minimized version ofauth.ts
in the above PRoidcBroker.ts
is a minimized version ofoidcBroker.ts
in the above PRFollow-on work is defined in a variety of tickets under the DUOS-2534 epic.
Testing Notes
Testing should include reviewing the developer panel in a browser when logging into a local instance.
Have you read Terra's Contributing Guide lately? If not, do that first.