|
|
|
@ -99,7 +99,7 @@ export class LoginComponent {
|
|
|
|
|
|
|
|
|
|
|
|
initializeLoginForm() {
|
|
|
|
initializeLoginForm() {
|
|
|
|
this.loginForm = new FormGroup({
|
|
|
|
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])
|
|
|
|
PASSWORD: new FormControl('', [Validators.required])
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -107,7 +107,7 @@ export class LoginComponent {
|
|
|
|
login() {
|
|
|
|
login() {
|
|
|
|
if (this.loginForm.valid) {
|
|
|
|
if (this.loginForm.valid) {
|
|
|
|
this.ucred.password = this.loginForm.get(FormConstants.PASSWORD)?.value;
|
|
|
|
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) => {
|
|
|
|
this.authService.authenticate(this.ucred).subscribe( (res: any) => {
|
|
|
|
const user = res?.user;
|
|
|
|
const user = res?.user;
|
|
|
|
this.storageService.setItem('user', JSON.stringify(res));
|
|
|
|
this.storageService.setItem('user', JSON.stringify(res));
|
|
|
|
|