Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #125 from NaturalSelectionLabs/feature/corss-domai…
Browse files Browse the repository at this point in the history
…n-redirect

Feature/corss domain redirect
  • Loading branch information
yzhe819 committed Nov 24, 2021
2 parents 6e14ee8 + 0f960c4 commit a271bac
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/views/Setup/Setup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,13 @@ export default class Setup extends Vue {
async initLoad() {
if (!(await RSS3.reconnect())) {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
if (config.subDomain.isSubDomainMode) {
// redirect back to root domain
window.location.host = config.subDomain.rootDomain;
} else {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
}
} else {
this.rss3 = await RSS3.get();
}
Expand Down
10 changes: 8 additions & 2 deletions src/views/Setup/SetupAccounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,14 @@ export default class SetupAccounts extends Vue {
async mounted() {
if (!(await RSS3.reconnect())) {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
if (config.subDomain.isSubDomainMode) {
// redirect back to root domain
window.location.host = config.subDomain.rootDomain;
} else {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
}
return;
}
this.rss3 = await RSS3.get();
if (sessionStorage.getItem('profile')) {
Expand Down
9 changes: 7 additions & 2 deletions src/views/Setup/SetupFootprints.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ export default class SetupFootprints extends Vue {
async mounted() {
if (!(await RSS3.reconnect())) {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
if (config.subDomain.isSubDomainMode) {
// redirect back to root domain
window.location.host = config.subDomain.rootDomain;
} else {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
}
return;
}
this.rss3 = await RSS3.get();
Expand Down
9 changes: 7 additions & 2 deletions src/views/Setup/SetupGitcoins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ export default class SetupGitcoins extends Vue {
async mounted() {
if (!(await RSS3.reconnect())) {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
if (config.subDomain.isSubDomainMode) {
// redirect back to root domain
window.location.host = config.subDomain.rootDomain;
} else {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
}
return;
}
this.rss3 = await RSS3.get();
Expand Down
9 changes: 7 additions & 2 deletions src/views/Setup/SetupNFTs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,13 @@ export default class SetupNFTs extends Vue {
async mounted() {
if (!(await RSS3.reconnect())) {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
if (config.subDomain.isSubDomainMode) {
// redirect back to root domain
window.location.host = config.subDomain.rootDomain;
} else {
sessionStorage.setItem('redirectFrom', this.$route.fullPath);
await this.$router.push('/');
}
return;
}
this.rss3 = await RSS3.get();
Expand Down

0 comments on commit a271bac

Please sign in to comment.