diff --git a/front/src/components/auth/LoginForm.vue b/front/src/components/auth/LoginForm.vue index 03e9b4ecb..7abb98586 100644 --- a/front/src/components/auth/LoginForm.vue +++ b/front/src/components/auth/LoginForm.vue @@ -111,7 +111,7 @@ export default { }, error: '', isLoading: false, - domain: document.domain + domain: location.hostname } }, computed: { @@ -134,7 +134,7 @@ export default { }, methods: { async submit () { - if (document.domain === this.$store.getters['instance/domain']) { + if (location.hostname === this.$store.getters['instance/domain']) { return await this.submitSession() } else { this.isLoading = true diff --git a/front/src/store/instance.ts b/front/src/store/instance.ts index 579440dbd..fd1c5258d 100644 --- a/front/src/store/instance.ts +++ b/front/src/store/instance.ts @@ -139,14 +139,7 @@ const store: Module = { const instanceUrl = state.instanceUrl ?? location.origin return instanceUrl + relativeUrl }, - domain: (state) => { - if (!state.instanceUrl) return null - - const url = state.instanceUrl - const parser = document.createElement('a') - parser.href = url - return parser.hostname - }, + domain: (state) => new URL(state.instanceUrl ?? location.origin).hostname, appDomain: () => location.hostname }, actions: {