jwt auth scaffolding

logging in now works

UI login component created
This commit is contained in:
Isaac Grynsztein
2020-04-16 22:35:34 -04:00
parent da8571fb1a
commit 1f3572a630
9 changed files with 185 additions and 13 deletions

View File

@@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { PostsService } from 'app/posts.services';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
usernameInput = '';
passwordInput = '';
registrationEnabled = true;
loggingIn = false;
constructor(private postsService: PostsService) { }
ngOnInit(): void {
}
login() {
this.loggingIn = true;
this.postsService.login(this.usernameInput, this.passwordInput).subscribe(res => {
this.loggingIn = false;
console.log(res);
}, err => {
this.loggingIn = false;
});
}
}