navigate to general by default
This commit is contained in:
parent
6ea7b70751
commit
ecdc07af9d
1 changed files with 2 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {AuthService} from "../services/auth/auth.service";
|
import {AuthService} from "../services/auth/auth.service";
|
||||||
|
|
||||||
|
|
@ -10,7 +9,6 @@ import {AuthService} from "../services/auth/auth.service";
|
||||||
})
|
})
|
||||||
export class LoginComponent implements OnInit {
|
export class LoginComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
login = '';
|
login = '';
|
||||||
password = '';
|
password = '';
|
||||||
errorMessage = '';
|
errorMessage = '';
|
||||||
|
|
@ -27,7 +25,8 @@ export class LoginComponent implements OnInit {
|
||||||
this.auth.sendAuthentication(this.login, this.password).subscribe(data => {
|
this.auth.sendAuthentication(this.login, this.password).subscribe(data => {
|
||||||
this.auth.finalizeAuthentication(data);
|
this.auth.finalizeAuthentication(data);
|
||||||
if (this.auth.islog === true) {
|
if (this.auth.islog === true) {
|
||||||
this.router.navigateByUrl('/private');
|
sessionStorage.setItem('login', this.login);
|
||||||
|
this.router.navigateByUrl('/general');
|
||||||
} else {
|
} else {
|
||||||
this.errorMessage = data.data.reason;
|
this.errorMessage = data.data.reason;
|
||||||
console.log(this.errorMessage);
|
console.log(this.errorMessage);
|
||||||
|
|
|
||||||
Reference in a new issue