ADDED VALIDATIOIN

ADDED VALIDATIOIN
PRE-PRODUCTION-2026-OSHO
Naeem Ullah 5 days ago
parent d4292cdefe
commit 384df6e03a

@ -99,7 +99,7 @@ export class LoginComponent {
initializeLoginForm() {
this.loginForm = new FormGroup({
USER_ID: new FormControl('', [Validators.required, Validators.pattern('^[a-z0-9]*$')]),
USER_ID: new FormControl('', [Validators.required, Validators.pattern('^[a-zA-Z0-9]*$')]),
PASSWORD: new FormControl('', [Validators.required])
})
}
@ -107,7 +107,7 @@ export class LoginComponent {
login() {
if (this.loginForm.valid) {
this.ucred.password = this.loginForm.get(FormConstants.PASSWORD)?.value;
this.ucred.userId = this.loginForm.get(FormConstants.USER_ID)?.value;
this.ucred.userId = this.loginForm.get(FormConstants.USER_ID)?.value?.toLowerCase().trim();
this.authService.authenticate(this.ucred).subscribe( (res: any) => {
const user = res?.user;
this.storageService.setItem('user', JSON.stringify(res));

@ -94,7 +94,7 @@ export class SetupUserComponent implements OnInit {
}
const newUser: SetupUser = {
userId: this.userForm.value.userId.trim(),
userId: this.userForm.value.userId.trim().toLowerCase(),
userFullname: this.userForm.value.userFullname.trim(),
email: this.userForm.value.email.trim(),
role: this.userForm.value.userRole,

Loading…
Cancel
Save