Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion web/server/vue-cli/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ router.beforeResolve((to, from, next) => {
store.dispatch(GET_AUTH_PARAMS).then(() => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (store.getters.authParams.requiresAuthentication &&
!store.getters.isAuthenticated
(!store.getters.authParams.sessionStillActive ||
!store.getters.isAuthenticated)
) {
// Redirect the user to the login page but keep the original path to
// redirect the user back once logged in.
Expand Down
2 changes: 0 additions & 2 deletions web/server/vue-cli/src/store/modules/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ const getters = {

const actions = {
[GET_AUTH_PARAMS]({ commit }) {
if (state.authParams) return state.authParams;

return new Promise(resolve => {
authService.getClient().getAuthParameters(
handleThriftError(params => {
Expand Down
3 changes: 2 additions & 1 deletion web/server/vue-cli/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export default {

computed: {
...mapGetters([
"authParams",
"isAuthenticated"
]),
ssoButtonText() {
Expand All @@ -185,7 +186,7 @@ export default {
},

created() {
if (this.isAuthenticated) {
if (this.isAuthenticated && this.authParams.sessionStillActive) {
const returnTo = this.$router.currentRoute.query["return_to"];
this.$router.replace(returnTo || { name: "products" });
}
Expand Down
Loading