From 544f927b567c4fe9a5cdaf0dee9c54dd3576ae81 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Tue, 19 Dec 2023 20:32:52 +0300 Subject: [PATCH 1/4] Restrict archived users from logging in --- src/app/login/login-form.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/app/login/login-form.component.ts b/src/app/login/login-form.component.ts index 5ace8d6207..65eb1ef118 100644 --- a/src/app/login/login-form.component.ts +++ b/src/app/login/login-form.component.ts @@ -141,9 +141,22 @@ export class LoginFormComponent { { withCredentials: true, domain: this.stateService.configuration.parentDomain }); } + checkArchiveStatus(name) { + this.couchService.get('_users/org.couchdb.user:' + name).subscribe((userData) => { + if (userData?.isArchived) { + console.log(userData); + this.errorHandler($localize`Member ${name} is archived`)(); + } + }); + return true; + } + login({ name, password }: { name: string, password: string }, isCreate: boolean) { const configuration = this.stateService.configuration; const userId = `org.couchdb.user:${name}`; + if (this.checkArchiveStatus(name)) { + return; + } this.pouchAuthService.login(name, password).pipe( switchMap(() => isCreate ? from(this.router.navigate([ 'users/update/' + name ])) : from(this.reRoute())), switchMap(() => forkJoin(this.pouchService.replicateFromRemoteDBs())), From ba5a98038ba0cdd57369f9ee8035374126c16e8f Mon Sep 17 00:00:00 2001 From: Mutugi <48474421+Mutugiii@users.noreply.github.com> Date: Tue, 19 Dec 2023 22:27:18 +0300 Subject: [PATCH 2/4] Remove console.log --- src/app/login/login-form.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/login/login-form.component.ts b/src/app/login/login-form.component.ts index 65eb1ef118..831432854f 100644 --- a/src/app/login/login-form.component.ts +++ b/src/app/login/login-form.component.ts @@ -144,7 +144,6 @@ export class LoginFormComponent { checkArchiveStatus(name) { this.couchService.get('_users/org.couchdb.user:' + name).subscribe((userData) => { if (userData?.isArchived) { - console.log(userData); this.errorHandler($localize`Member ${name} is archived`)(); } }); From e32b33870c5758eea940c437b58cf8e349fb150e Mon Sep 17 00:00:00 2001 From: Mutugi <48474421+Mutugiii@users.noreply.github.com> Date: Thu, 21 Dec 2023 21:35:14 +0300 Subject: [PATCH 3/4] Update login-form.component.ts --- src/app/login/login-form.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/login/login-form.component.ts b/src/app/login/login-form.component.ts index 831432854f..15d2ff6900 100644 --- a/src/app/login/login-form.component.ts +++ b/src/app/login/login-form.component.ts @@ -144,7 +144,7 @@ export class LoginFormComponent { checkArchiveStatus(name) { this.couchService.get('_users/org.couchdb.user:' + name).subscribe((userData) => { if (userData?.isArchived) { - this.errorHandler($localize`Member ${name} is archived`)(); + this.errorHandler($localize`Member ${name} is not registered`)(); } }); return true; From d906a3a116cde8e76d96862529a9f7431f2bda03 Mon Sep 17 00:00:00 2001 From: dogi Date: Wed, 27 Dec 2023 04:45:38 -0500 Subject: [PATCH 4/4] Update package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f79028d264..cd340bad58 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "planet", "license": "AGPL-3.0", - "version": "0.13.92", + "version": "0.14.1", "myplanet": { - "latest": "v0.11.97", - "min": "v0.11.72" + "latest": "v0.12.41", + "min": "v0.11.60" }, "scripts": { "ng": "ng",