Fix Bug 60353 - Accounts: Sign Up. Portal registration fails. (@self.json 401)

This commit is contained in:
Alexey Safronov 2022-12-27 13:45:47 +03:00
parent 61607973ae
commit 8cf3f74aff
2 changed files with 13 additions and 8 deletions

View File

@ -53,14 +53,15 @@ class AuthStore {
this.skipRequest = skipRequest;
try {
await this.userStore.init();
} catch (e) {
console.error(e);
}
await this.settingsStore.init();
const requests = [];
requests.push(this.settingsStore.init());
if (this.settingsStore.isLoaded && this.settingsStore.socketUrl) {
requests.push(this.userStore.init());
} else {
this.userStore.setIsLoaded(true);
}
if (this.isAuthenticated && !skipRequest) {
requests.push(
@ -222,7 +223,7 @@ class AuthStore {
get isAuthenticated() {
return (
this.userStore.isAuthenticated ||
(this.settingsStore.isLoaded && this.settingsStore.socketUrl) || //this.userStore.isAuthenticated ||
this.settingsStore.tenantStatus === TenantStatus.PortalRestore
);
}

View File

@ -31,7 +31,11 @@ class UserStore {
this.setIsLoading(true);
await this.loadCurrentUser();
try {
await this.loadCurrentUser();
} catch (e) {
console.error(e);
}
this.setIsLoading(false);
this.setIsLoaded(true);