Skip to content
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

Logout in oc10 while click logout in web #6939

Merged
merged 4 commits into from
May 30, 2022
Merged

Logout in oc10 while click logout in web #6939

merged 4 commits into from
May 30, 2022

Conversation

AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented May 11, 2022

Description

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented May 11, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

packages/web-runtime/src/store/user.js Outdated Show resolved Hide resolved
router.push({ name: 'login' })
}

// Remove signed in user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need the store cleanups before the redirect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is something I can't answer yet, we do a redirect, so I thought the store should be cleaned while accessing the page the next time.
I moved this code path, as there is already a redirect happening in one of these dispatched actions

@ownclouders
Copy link
Contributor

Results for oCISSharingAndUpload https://drone.owncloud.com/owncloud/web/25502/67/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

Comment on lines +34 to +37
if (options.clearOIDCLoginState) {
// clear oidc client state
vueAuthInstance.clearLoginState()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kulmann this code path triggers a redirect already and interferes with redirecting to the oc10 log out,
I don't call vueAuthInstance.clearLoginState()anymore if we are logged in via oauth2, is this ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really sufficient for oauth2 to skip that step? o_O

@sonarcloud
Copy link

sonarcloud bot commented May 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@AlexAndBear AlexAndBear requested a review from kulmann May 13, 2022 11:50
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀
FYI, found some other issues with cyclic action dispatching... will tackle that in a subsequent PR that refactors most of the auth related code. 😅

@pascuflow
Copy link

Pulled latest from master to test this, after logging out of Web, if you then log in with different credentials, you are still logged in as previous user.

@pascuflow
Copy link

Fixed by adding sessionStorage.clear() before logout() is called in web/packages/web-runtime/src/components/Topbar/UserMenu.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging out of oC web does not log out of oC classic
4 participants