1- import { Component , OnInit } from '@angular/core' ;
1+ import { AfterViewInit , Component , OnInit } from '@angular/core' ;
22import { AuthzResolverService } from '@perun-web-apps/perun/openapi' ;
33import { FormControl , Validators } from '@angular/forms' ;
44import { Router } from '@angular/router' ;
@@ -9,7 +9,7 @@ import { AuthService, InitAuthService } from '@perun-web-apps/perun/services';
99 templateUrl : './login-screen-service-access.component.html' ,
1010 styleUrls : [ './login-screen-service-access.component.css' ] ,
1111} )
12- export class LoginScreenServiceAccessComponent implements OnInit {
12+ export class LoginScreenServiceAccessComponent implements OnInit , AfterViewInit {
1313 usernameCtrl = new FormControl < string > ( null , [ Validators . required ] ) ;
1414 passwordCtrl = new FormControl < string > ( null , [ Validators . required ] ) ;
1515 wrongUsernameOrPassword = false ;
@@ -51,7 +51,12 @@ export class LoginScreenServiceAccessComponent implements OnInit {
5151
5252 if ( sessionStorage . getItem ( 'baAfterLogout' ) ) {
5353 this . afterLogout = true ;
54- sessionStorage . setItem ( 'baAfterLogout' , 'false' ) ;
54+ }
55+ }
56+
57+ ngAfterViewInit ( ) : void {
58+ if ( ! sessionStorage . getItem ( 'baLogout' ) ) {
59+ sessionStorage . removeItem ( 'baAfterLogout' ) ;
5560 }
5661 }
5762}
0 commit comments