header sso link based on main domain or fallback to hostname

This commit is contained in:
axolotle 2024-02-09 04:11:48 +01:00
parent 237b36e2e2
commit e5a3f5df2b
2 changed files with 8 additions and 3 deletions

View file

@ -18,7 +18,7 @@
<b-navbar-nav class="ml-auto"> <b-navbar-nav class="ml-auto">
<li class="nav-item"> <li class="nav-item">
<b-button <b-button
href="/yunohost/sso" :href="ssoLink"
variant="primary" size="sm" block variant="primary" size="sm" block
> >
{{ $t('user_interface_link') }} <icon iname="user" /> {{ $t('user_interface_link') }} <icon iname="user" />
@ -100,7 +100,8 @@ export default {
'transitions', 'transitions',
'transitionName', 'transitionName',
'waiting', 'waiting',
'theme' 'theme',
'ssoLink'
]) ])
}, },

View file

@ -142,6 +142,7 @@ export default {
// and login prompt will be shown automaticly // and login prompt will be shown automaticly
await dispatch('GET_YUNOHOST_INFOS') await dispatch('GET_YUNOHOST_INFOS')
commit('SET_CONNECTED', true) commit('SET_CONNECTED', true)
await dispatch('GET', { uri: 'domains', storeKey: 'domains' })
}, },
'RESET_CONNECTED' ({ commit }) { 'RESET_CONNECTED' ({ commit }) {
@ -383,6 +384,9 @@ export default {
}, },
routerKey: state => state.routerKey, routerKey: state => state.routerKey,
breadcrumb: state => state.breadcrumb, breadcrumb: state => state.breadcrumb,
transitionName: state => state.transitionName transitionName: state => state.transitionName,
ssoLink: (state, getters) => {
return `//${getters.mainDomain ?? state.host}/yunohost/sso`
}
} }
} }