Replace deprecated document.domain with location.hostname
This commit is contained in:
parent
30731580c1
commit
40c7e08744
|
@ -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
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue