diff --git a/console/src/app/pages/user-detail/user-mfa/user-mfa.component.ts b/console/src/app/pages/user-detail/user-mfa/user-mfa.component.ts
index 0a574e47f..6bd144c10 100644
--- a/console/src/app/pages/user-detail/user-mfa/user-mfa.component.ts
+++ b/console/src/app/pages/user-detail/user-mfa/user-mfa.component.ts
@@ -2,7 +2,6 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { MFAState, MfaType, MultiFactor, UserView } from 'src/app/proto/generated/management_pb';
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
-import { ToastService } from 'src/app/services/toast.service';
export interface MFAItem {
@@ -23,11 +22,11 @@ export class UserMfaComponent implements OnInit, OnDestroy {
public MfaType: any = MfaType;
public MFAState: any = MFAState;
- constructor(private mgmtUserService: MgmtUserService,
- private toast: ToastService) { }
+
+ public error: string = '';
+ constructor(private mgmtUserService: MgmtUserService) { }
public ngOnInit(): void {
- console.log(this.user);
this.getOTP();
}
@@ -37,31 +36,12 @@ export class UserMfaComponent implements OnInit, OnDestroy {
}
public getOTP(): void {
- console.log('otp', this.user);
this.mgmtUserService.getUserMfas(this.user.id).then(mfas => {
this.mfaSubject.next(mfas.toObject().mfasList);
- console.log(mfas.toObject());
+ this.error = '';
}).catch(error => {
console.error(error);
- this.toast.showError(error.message);
+ this.error = error.message;
});
}
-
- // public deleteMFA(type: MfaType): void {
- // if (type === MfaType.MFATYPE_OTP) {
- // this.userService.RemoveMfaOTP().then(() => {
- // this.toast.showInfo('OTP Deleted');
-
- // const index = this.mfaSubject.value.findIndex(mfa => mfa.type === type);
- // if (index > -1) {
- // const newValues = this.mfaSubject.value;
- // newValues.splice(index, 1);
- // this.mfaSubject.next(newValues);
- // }
-
- // }).catch(error => {
- // this.toast.showError(error.message);
- // });
- // }
- // }
}
diff --git a/console/src/app/pages/user-detail/validators.ts b/console/src/app/pages/user-detail/validators.ts
new file mode 100644
index 000000000..e43562048
--- /dev/null
+++ b/console/src/app/pages/user-detail/validators.ts
@@ -0,0 +1,45 @@
+import { FormControl } from '@angular/forms';
+
+export function symbolValidator(c: FormControl): any {
+ const REGEXP = /[^a-z0-9]/gi;
+
+ return REGEXP.test(c.value) ? null : {
+ invalid: true,
+ symbolValidator: {
+ valid: false,
+ },
+ };
+}
+
+export function numberValidator(c: FormControl): any {
+ const REGEXP = /[0-9]/g;
+
+ return REGEXP.test(c.value) ? null : {
+ invalid: true,
+ numberValidator: {
+ valid: false,
+ },
+ };
+}
+
+export function upperCaseValidator(c: FormControl): any {
+ const REGEXP = /[A-Z]/g;
+
+ return REGEXP.test(c.value) ? null : {
+ invalid: true,
+ upperCaseValidator: {
+ valid: false,
+ },
+ };
+}
+
+export function lowerCaseValidator(c: FormControl): any {
+ const REGEXP = /[a-z]/g;
+
+ return REGEXP.test(c.value) ? null : {
+ invalid: true,
+ lowerCaseValidator: {
+ valid: false,
+ },
+ };
+}
diff --git a/console/src/app/pipes/password-pattern.pipe.spec.ts b/console/src/app/pipes/password-pattern.pipe.spec.ts
deleted file mode 100644
index 1253c24a0..000000000
--- a/console/src/app/pipes/password-pattern.pipe.spec.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { PasswordPatternPipe } from './password-pattern.pipe';
-
-describe('PasswordPatternPipe', () => {
- it('create an instance', () => {
- const pipe = new PasswordPatternPipe();
- expect(pipe).toBeTruthy();
- });
-});
diff --git a/console/src/app/pipes/password-pattern.pipe.ts b/console/src/app/pipes/password-pattern.pipe.ts
deleted file mode 100644
index cc604df3e..000000000
--- a/console/src/app/pipes/password-pattern.pipe.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Pipe, PipeTransform } from '@angular/core';
-
-import { PasswordComplexityPolicy } from '../proto/generated/management_pb';
-import { OrgService } from '../services/org.service';
-
-@Pipe({
- name: 'passwordPattern',
-})
-export class PasswordPatternPipe implements PipeTransform {
-
- constructor(private orgService: OrgService) { }
-
- transform(policy: PasswordComplexityPolicy.AsObject, ...args: unknown[]): string {
- return this.orgService.getLocalizedComplexityPolicyPatternErrorString(policy);
- }
-
-}
diff --git a/console/src/app/pipes/pipes.module.ts b/console/src/app/pipes/pipes.module.ts
index 910f8d73c..976c10f05 100644
--- a/console/src/app/pipes/pipes.module.ts
+++ b/console/src/app/pipes/pipes.module.ts
@@ -3,13 +3,11 @@ import { NgModule } from '@angular/core';
import { MomentModule } from 'ngx-moment';
import { LocalizedDatePipe } from './localized-date.pipe';
-import { PasswordPatternPipe } from './password-pattern.pipe';
@NgModule({
declarations: [
LocalizedDatePipe,
- PasswordPatternPipe,
],
imports: [
CommonModule,
@@ -17,7 +15,6 @@ import { PasswordPatternPipe } from './password-pattern.pipe';
],
exports: [
LocalizedDatePipe,
- PasswordPatternPipe,
],
})
export class PipesModule { }
diff --git a/console/src/app/services/org.service.ts b/console/src/app/services/org.service.ts
index 0cf123f26..81961612b 100644
--- a/console/src/app/services/org.service.ts
+++ b/console/src/app/services/org.service.ts
@@ -12,6 +12,7 @@ import {
OrgDomainSearchQuery,
OrgDomainSearchRequest,
OrgDomainSearchResponse,
+ OrgIamPolicy,
OrgID,
OrgMemberRoles,
OrgMemberSearchRequest,
@@ -198,6 +199,14 @@ export class OrgService {
// Policy
+ public async GetMyOrgIamPolicy(): Promise
{
+ return await this.request(
+ c => c.getMyOrgIamPolicy,
+ new Empty(),
+ f => f,
+ );
+ }
+
public async GetPasswordAgePolicy(): Promise {
const req = new Empty();
diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json
index 77b7a1921..fa27a77eb 100644
--- a/console/src/assets/i18n/de.json
+++ b/console/src/assets/i18n/de.json
@@ -164,7 +164,12 @@
"VALIDATION": {
"INVALIDPATTERN": "Das Password muss aus mindestens 8 Zeichen bestehen und einen Grossbuchstaben, ein Sonderzeichen und eine Zahl enthalten. Die maximale Anzahl an Zeichen ist 72!",
"REQUIRED": "Das Feld ist leer",
- "MINLENGTH":"Das Password muss mindestens {{minLength}} Zeichen lang sein!"
+ "MINLENGTH":"Das Password muss mindestens {{requiredLength}} Zeichen lang sein!",
+ "NOEMAIL":"Username darf keine email sein!",
+ "UPPERCASEMISSING":"Password muss einen Großbuchstaben beinhalten",
+ "LOWERCASEMISSING":"Password muss einen Kleinbuchstaben beinhalten",
+ "SYMBOLERROR":"Das Password muss ein Symbol beinhalten!",
+ "NUMBERERROR":"Das Password muss eine Nummer beinhalten!"
},
"STATE": {
"0":"unbekannt",
@@ -287,9 +292,9 @@
"PROJECT": {
"PAGES": {
"TITLE": "Projekt",
- "DESCRIPTION": "Hier können Sie wichtige Einstellungen prüfen und die Daten einsehen, mit denen das der Dienst konfiguriert worden ist",
+ "DESCRIPTION": "Hier können Sie wichtige Einstellungen prüfen und die Daten einsehen, mit denen der Dienst konfiguriert worden ist",
"LIST": "Projekte",
- "LISTDESCRIPTION":"Hier finden Sie alle Projekte, für die Sie Aktionen anzeigen oder ausführen dürfen. Wenn Sie kein Projekt finden können, wenden Sie sich an einen Projektbesitzer oder an jemanden mit den entsprechenden Rechten, um Projektzugriff zu erhalten.",
+ "LISTDESCRIPTION":"Hier finden Sie alle Projekte, für die Sie Aktionen anzeigen oder ausführen dürfen. Wenn Sie Ihr Projekt nicht finden können, wenden Sie sich an einen Projektbesitzer oder an jemanden mit den entsprechenden Rechten, um Projektzugriff zu erhalten.",
"DETAIL": "Detail",
"CREATE": "Projekt erstellen",
"CREATE_DESC": "Geben Sie den Namen ein",
diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json
index a2bb38369..c398d6916 100644
--- a/console/src/assets/i18n/en.json
+++ b/console/src/assets/i18n/en.json
@@ -52,7 +52,7 @@
"DETAIL": "Detail",
"CREATE": "Create",
"MY": "My Informations",
- "LOGINNAMES":"Login names",
+ "LOGINNAMES":"Loginnames",
"LOGINNAMESDESC":"You can log into zitadel with these names",
"COPY":"Copy to clipboard",
"COPIED":"Copied to clipboard!",
@@ -164,7 +164,12 @@
"VALIDATION": {
"INVALIDPATTERN": "The password must consist of at least 8 characters and contain a capital letter, a special character and a number. The maximum length is 72.",
"REQUIRED": "The input field is empty",
- "MINLENGTH":"The password has to be at least {{minLength}} characters long!"
+ "MINLENGTH":"The password has to be at least {{requiredLength}} characters long!",
+ "NOEMAIL":"Username can not be an email",
+ "UPPERCASEMISSING":"An uppercase character is needed!",
+ "LOWERCASEMISSING":"A lowercase character is needed!",
+ "SYMBOLERROR":"The password must include a symbol!",
+ "NUMBERERROR":"The password must include a number!"
},
"STATE": {
"0":"unbekannt",
@@ -223,7 +228,6 @@
"SYMBOLERROR":"The password must include a symbol!",
"NUMBERERROR":"The password must include a number!",
"PATTERNERROR":"The required pattern is not fulfilled!"
-
},
"PWD_AGE": {
"TITLE":"Password Age",