diff options
| author | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-03-14 21:47:33 +0200 |
|---|---|---|
| committer | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-03-14 21:47:33 +0200 |
| commit | e4fc300d2fe82084c67c50258c76b60248850863 (patch) | |
| tree | 2b836291af4bc6801d7d809c828eb3e7d58a027a /src/app/components/login/login.component.ts | |
| parent | afe30ab78432d16c42b2f19e3bd8355e3f27a0e1 (diff) | |
| parent | 988c09b9233fd356b056b62593494772a2061993 (diff) | |
| download | DevHive-Angular-e4fc300d2fe82084c67c50258c76b60248850863.tar DevHive-Angular-e4fc300d2fe82084c67c50258c76b60248850863.tar.gz DevHive-Angular-e4fc300d2fe82084c67c50258c76b60248850863.zip | |
Merge branch 'dev' of https://github.com/Team-Kaleidoscope/DevHive-Angular into rating_system
Diffstat (limited to 'src/app/components/login/login.component.ts')
| -rw-r--r-- | src/app/components/login/login.component.ts | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index c3fb79c..edbc461 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { FormGroup, FormBuilder, Validators, FormControl, AbstractControl } from '@angular/forms'; +import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms'; import { Router } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { UserService } from 'src/app/services/user.service'; @@ -34,26 +34,18 @@ export class LoginComponent implements OnInit { onSubmit(): void { this._errorBar.hideError(); - this._userService.loginUserRequest(this.loginUserFormGroup).subscribe( - (res: object) => { + this._userService.loginUserRequest(this.loginUserFormGroup).subscribe({ + next: (res: object) => { this._tokenService.setUserTokenToSessionStorage(res); this._router.navigate(['/']); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } onRedirectRegister(): void { this._router.navigate(['/register']); } - - get username(): AbstractControl | null { - return this.loginUserFormGroup.get('username'); - } - - get password(): AbstractControl | null { - return this.loginUserFormGroup.get('password'); - } } |
