Fix
This commit is contained in:
@@ -5,6 +5,7 @@ import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { User } from "../../models/user";
|
||||
|
||||
@Component({
|
||||
selector: "app-login",
|
||||
@@ -50,7 +51,7 @@ export class LoginComponent implements OnInit {
|
||||
}
|
||||
|
||||
get createCtrls() {
|
||||
return this.loginForm.controls;
|
||||
return this.createForm.controls;
|
||||
}
|
||||
|
||||
onLoginSubmit() {
|
||||
@@ -85,8 +86,12 @@ export class LoginComponent implements OnInit {
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
let createUser = new User();
|
||||
createUser.login = this.createCtrls.username.value;
|
||||
createUser.password = this.createCtrls.password.value;
|
||||
|
||||
this.authenticationService
|
||||
.login(this.createCtrls.username.value, this.createCtrls.password.value)
|
||||
.create(createUser)
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
Reference in New Issue
Block a user