navigate to general by default

This commit is contained in:
NyxiumYuuki 2021-05-28 21:03:34 +02:00
parent 6ea7b70751
commit ecdc07af9d

View file

@ -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);