Skip to content

Commit 99a4952

Browse files
authored
Merge pull request #4622 from bruntib/invalid_auth_token
[fix] Blank page on invalid session token
2 parents 6e0215b + 141e12a commit 99a4952

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

web/server/vue-cli/src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ router.beforeResolve((to, from, next) => {
6464
store.dispatch(GET_AUTH_PARAMS).then(() => {
6565
if (to.matched.some(record => record.meta.requiresAuth)) {
6666
if (store.getters.authParams.requiresAuthentication &&
67-
!store.getters.isAuthenticated
67+
(!store.getters.authParams.sessionStillActive ||
68+
!store.getters.isAuthenticated)
6869
) {
6970
// Redirect the user to the login page but keep the original path to
7071
// redirect the user back once logged in.

web/server/vue-cli/src/store/modules/auth.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ const getters = {
3737

3838
const actions = {
3939
[GET_AUTH_PARAMS]({ commit }) {
40-
if (state.authParams) return state.authParams;
41-
4240
return new Promise(resolve => {
4341
authService.getClient().getAuthParameters(
4442
handleThriftError(params => {

web/server/vue-cli/src/views/Login.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export default {
167167
168168
computed: {
169169
...mapGetters([
170+
"authParams",
170171
"isAuthenticated"
171172
]),
172173
ssoButtonText() {
@@ -185,7 +186,7 @@ export default {
185186
},
186187
187188
created() {
188-
if (this.isAuthenticated) {
189+
if (this.isAuthenticated && this.authParams.sessionStillActive) {
189190
const returnTo = this.$router.currentRoute.query["return_to"];
190191
this.$router.replace(returnTo || { name: "products" });
191192
}

0 commit comments

Comments
 (0)