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

Stuck after session expired #7491

Merged
merged 5 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/unreleased/bugfix-stuck-after-session-expired
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Bugfix: Stuck After Session Expired

We've fixed exit link to redirect to login once session expires

We've removed the logout click handler and created a new logout component

https://github.com/owncloud/web/issues/7453

gitstart marked this conversation as resolved.
Show resolved Hide resolved
https://github.com/owncloud/web/pull/7491
13 changes: 3 additions & 10 deletions packages/web-runtime/src/pages/accessDenied.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<span v-translate>Login Error</span>
</h3>
<h4 v-translate class="oc-mb-m">Your user session is invalid or has expired.</h4>
<div v-translate class="oc-mb-m" @click="performLogout">
If you like to login with a different user please proceed to <a id="exitAnchor">exit</a>.
<div v-translate class="oc-mb-m">
If you like to login with a different user please proceed to
<router-link id="exitAnchor" :to="{ name: 'login' }">exit</router-link>
gitstart marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div v-translate class="oc-m-rm">
<strong>Attention:</strong> this will log you out from all applications you are running in
Expand All @@ -31,7 +32,6 @@
<script lang="ts">
import { defineComponent } from '@vue/runtime-core'
import { mapGetters } from 'vuex'
import { authService } from '../services/auth'
export default defineComponent({
name: 'AccessDeniedPage',
computed: {
Expand Down Expand Up @@ -74,13 +74,6 @@ export default defineComponent({
backgroundImg() {
return this.configuration.currentTheme.loginPage.backgroundImg
}
},
methods: {
performLogout(event) {
if (event.target.id === 'exitAnchor') {
authService.logoutUser()
}
}
}
})
</script>
15 changes: 15 additions & 0 deletions packages/web-runtime/src/pages/logout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<div>
<p>Please wait while you're being logged out.</p>
gitstart marked this conversation as resolved.
Show resolved Hide resolved
</div>
</template>
<script>
import { authService } from '../services/auth'
export default {
name: 'LogoutPage',
created() {
gitstart marked this conversation as resolved.
Show resolved Hide resolved
authService.logoutUser()
gitstart marked this conversation as resolved.
Show resolved Hide resolved
this.router.push({ name: 'login' })
}
}
</script>
7 changes: 7 additions & 0 deletions packages/web-runtime/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Router from 'vue-router'
import AccessDeniedPage from '../pages/accessDenied.vue'
import Account from '../pages/account.vue'
import LoginPage from '../pages/login.vue'
import LogoutPage from '../pages/logout.vue'
import OidcCallbackPage from '../pages/oidcCallback.vue'
import ResolvePublicLinkPage from '../pages/resolvePublicLink.vue'
import { setupAuthGuard } from './setupAuthGuard'
Expand Down Expand Up @@ -40,6 +41,12 @@ export const router = patchRouter(
component: LoginPage,
meta: { title: $gettext('Login') }
},
{
path: '/logout',
name: 'logout',
component: LogoutPage,
meta: { title: $gettext('Logout') }
},
{
path: '/oidc-callback',
name: 'oidcCallback',
Expand Down