Project

General

Profile

« Previous | Next » 

Revision 52836

added cookie-law banner - 403 authorization via ui and new usage-stats pages

View differences:

authentication.service.ts
86 86
            deleteCookie('openAIREUser');
87 87
            deleteCookie('AccessToken');
88 88
            this.isLoggedIn = false;
89
            this.router.navigate(['/landing']);
90
          },
91
          () => {
92
            if ( sessionStorage.getItem("state.location") ) {
93
              let state = sessionStorage.getItem("state.location");
94
              sessionStorage.removeItem("state.location");
95
              console.log(`tried to login - returning to state: ${state}`);
96
              if ( !this.getIsUserLoggedIn() ) {
97
                console.log('user hasn\'t logged in yet -- going to landing');
98
                this.router.navigate(['/landing']);
99
              } else if (this.redirectUrl) {
100
                this.router.navigate([this.redirectUrl]);
101
              } else {
102
                this.router.navigate([state]);
103
              }
104
            }
89 105
          }
90 106
        );
91 107
      } else {
92 108
        this.isLoggedIn = true;
93 109
        console.log(`the current user is: ${sessionStorage.getItem('name')}, ${sessionStorage.getItem('email')}, ${sessionStorage.getItem('role')}`);
94 110
      }
95
      if ( sessionStorage.getItem("state.location") ) {
96
        let state = sessionStorage.getItem("state.location");
97
        sessionStorage.removeItem("state.location");
98
        console.log(`tried to login - returning to state: ${state}`);
99
        if ( !this.getIsUserLoggedIn() ) {
100
          this.router.navigate(['/landing']);
101
        } else if (this.redirectUrl) {
102
          this.router.navigate([this.redirectUrl]);
103
        } else {
104
          this.router.navigate([state]);
105
        }
106
      }
107 111
    }
108 112
  }
109 113

  

Also available in: Unified diff