import Vue from ‘vue’
import App from ‘@/App.vue’
import router from ‘@/router’
import store from ‘@/store’
import i18n from ‘@/i18n’
import VueLodash from ‘vue-lodash’
import lodash from ‘lodash’
import Notifications from ‘vue-notification’
import { BootstrapVue, BootstrapVueIcons } from ‘bootstrap-vue’
import ‘bootstrap/dist/css/bootstrap.css’
import ‘bootstrap-vue/dist/bootstrap-vue.css’
import ‘@/assets/sass/_index.sass’
import ‘@/plugins/keycloak’
import updateToken from ‘@/middlewares/updateToken’
Vue.use(VueLodash, { lodash: lodash })
Vue.use(Notifications)
Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)
Vue.config.productionTip = false
Vue.$keycloak
.logout({ redirectUri: ‘localhost:50000’ })
.init({ onLoad: ‘login-required’, redirectUri: process.env.BASE_URL })
.then(() => {
new Vue({
router,
store,
i18n,
render: h => h(App)
}).$mount('#app')
window.onfocus = () => {
updateToken()
}
})
And in my login button I have:
async logout () {
await this.$keycloak.logout(process.env.BASE_URL)
this.$router.push(process.env.BASE_URL)
}
This does not work at all.
I have tried putting redirect Uri in .login in .logout in .init as another property.
None of these work and my redirect URI does not change.
I logout and when I login I am on the same page I logged out. I want to be returned to the home page hence this redirectUri…