mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-27 15:10:55 +03:00
jwt auth scaffolding
logging in now works UI login component created
This commit is contained in:
31
src/app/components/login/login.component.ts
Normal file
31
src/app/components/login/login.component.ts
Normal 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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user