Skip to content

Commit

Permalink
Add oc10 logout
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed May 11, 2022
1 parent b9d1476 commit 192d2fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-not-logged-out-if-oC10-backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Not logged out if backend is ownCloud 10

We've fixed an issue, where the user won't be logged out if the backend is ownCloud 10

https://github.com/owncloud/web/pull/6939
https://github.com/owncloud/web/issues/5886
3 changes: 2 additions & 1 deletion config/config.json.sample-oc10
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"auth": {
"clientId": "UmCVsEIxdWmssxa6uVRRPC3txYBVN4qqxooJbsPhuuoPmHk9Pt9Oy68N4ZaKXUYy",
"url": "http://localhost:8080/index.php/apps/oauth2/api/v1/token",
"authUrl": "http://localhost:8080/index.php/apps/oauth2/authorize"
"authUrl": "http://localhost:8080/index.php/apps/oauth2/authorize",
"logoutUrl": "http://localhost:8080/index.php/logout"
},
"apps": [
"files",
Expand Down
3 changes: 2 additions & 1 deletion dev/docker/oc10.web.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"auth": {
"clientId": "M8W5mo3wQV3VHWYsaYpWhkr8dwa949i4GljCkedHhl7GWqmHMkxSeJgK2PcS0jt5",
"url": "http://host.docker.internal:8080/index.php/apps/oauth2/api/v1/token",
"authUrl": "http://host.docker.internal:8080/index.php/apps/oauth2/authorize"
"authUrl": "http://host.docker.internal:8080/index.php/apps/oauth2/authorize",
"logoutUrl": "http://host.docker.internal:8080/index.php/logout"
},
"apps": [
"files",
Expand Down
22 changes: 14 additions & 8 deletions packages/web-runtime/src/store/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,23 @@ const actions = {
// clear oidc client state
vueAuthInstance.clearLoginState()
},
async logout({ dispatch }) {
const logoutFinalizer = (forceRedirect = false) => {
// Remove signed in user
dispatch('cleanUpLoginState')
dispatch('hideModal')
dispatch('loadSettingsValues')
async logout(context) {
const logoutFinalizer = (isOauth2 = false) => {
// Force redirect
if (isOauth2) {
const logoutUrl = context.getters?.configuration?.auth?.logoutUrl

if (logoutUrl) {
return (window.location = logoutUrl)
}

// Force redirect to login
if (forceRedirect) {
router.push({ name: 'login' })
}

// Remove signed in user
context.dispatch('cleanUpLoginState')
context.dispatch('hideModal')
context.dispatch('loadSettingsValues')
}
const u = await vueAuthInstance.getStoredUserObject()

Expand Down

0 comments on commit 192d2fd

Please sign in to comment.