Replace deprecated document.domain with location.hostname

This commit is contained in:
Kasper Seweryn 2022-05-05 21:07:20 +00:00 committed by Georg Krause
parent 30731580c1
commit 40c7e08744
2 changed files with 3 additions and 10 deletions

View File

@ -111,7 +111,7 @@ export default {
}, },
error: '', error: '',
isLoading: false, isLoading: false,
domain: document.domain domain: location.hostname
} }
}, },
computed: { computed: {
@ -134,7 +134,7 @@ export default {
}, },
methods: { methods: {
async submit () { async submit () {
if (document.domain === this.$store.getters['instance/domain']) { if (location.hostname === this.$store.getters['instance/domain']) {
return await this.submitSession() return await this.submitSession()
} else { } else {
this.isLoading = true this.isLoading = true

View File

@ -139,14 +139,7 @@ const store: Module<State, RootState> = {
const instanceUrl = state.instanceUrl ?? location.origin const instanceUrl = state.instanceUrl ?? location.origin
return instanceUrl + relativeUrl return instanceUrl + relativeUrl
}, },
domain: (state) => { domain: (state) => new URL(state.instanceUrl ?? location.origin).hostname,
if (!state.instanceUrl) return null
const url = state.instanceUrl
const parser = document.createElement('a')
parser.href = url
return parser.hostname
},
appDomain: () => location.hostname appDomain: () => location.hostname
}, },
actions: { actions: {