Replace deprecated document.domain with location.hostname
This commit is contained in:
parent
30731580c1
commit
40c7e08744
|
@ -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
|
||||
|
|
|
@ -139,14 +139,7 @@ const store: Module<State, RootState> = {
|
|||
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: {
|
||||
|
|
Loading…
Reference in New Issue