Fixed bug that caused users with large amounts of data to have extremely large tokens

Subfolders are now ensured to exist with the normal downloading method

Initialization now happens after token retrieval to avoid failed requests

Fixed bug that caused login to be called twice, introducing a possible race condition
This commit is contained in:
Tzahi12345
2020-05-03 18:55:42 -04:00
parent 26ad195597
commit f73ec2dd94
4 changed files with 16 additions and 13 deletions

View File

@@ -41,12 +41,15 @@ export class LoginComponent implements OnInit {
}
login() {
if (this.loginPasswordInput === '') {
if (this.loginPasswordInput === '' || this.loggingIn) {
return;
}
this.loggingIn = true;
this.postsService.login(this.loginUsernameInput, this.loginPasswordInput).subscribe(res => {
this.loggingIn = false;
if (res['token']) {
this.postsService.afterLogin(res['user'], res['token'], res['permissions'], res['available_permissions']);
}
}, err => {
this.loggingIn = false;
});