style: format code and add prettier configuration files
This commit is contained in:
parent
3e0b17ebe6
commit
395c1bc75f
39 changed files with 338 additions and 207 deletions
|
@ -8,14 +8,14 @@ import { Router } from '@angular/router';
|
|||
selector: 'app-login',
|
||||
imports: [ReactiveFormsModule],
|
||||
templateUrl: './login.component.html',
|
||||
styleUrl: './login.component.css'
|
||||
styleUrl: './login.component.css',
|
||||
})
|
||||
export class LoginComponent {
|
||||
public loginForm!: FormGroup;
|
||||
public invalidCredentials = false;
|
||||
private pb = new PocketBase(environment.POCKETBASE);
|
||||
|
||||
constructor(private router: Router) { };
|
||||
constructor(private router: Router) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loginForm = new FormGroup({
|
||||
|
@ -29,13 +29,17 @@ export class LoginComponent {
|
|||
}
|
||||
|
||||
submit() {
|
||||
this.pb.collection("users").authWithPassword(
|
||||
this.loginForm.get('email')?.value,
|
||||
this.loginForm.get('password')?.value
|
||||
).then(() => {
|
||||
this.pb
|
||||
.collection('users')
|
||||
.authWithPassword(
|
||||
this.loginForm.get('email')?.value,
|
||||
this.loginForm.get('password')?.value,
|
||||
)
|
||||
.then(() => {
|
||||
this.router.navigate(['dashboard']);
|
||||
}).catch(() => {
|
||||
this.invalidCredentials = true;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.invalidCredentials = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue