fix: state handler redirect, project sidenav default, nav (#3615)

This commit is contained in:
Max Peintner 2022-05-11 15:05:34 +02:00 committed by GitHub
parent 00e042ea44
commit 9291269075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@
<a <a
class="nav-item" class="nav-item"
[routerLinkActive]="['active']" [routerLinkActive]="['active']"
[routerLinkActiveOptions]="{ exact: true }" [routerLinkActiveOptions]="{ exact: false }"
[routerLink]="['/org-settings']" [routerLink]="['/org-settings']"
> >
<span class="label">{{ 'MENU.SETTINGS' | translate }}</span> <span class="label">{{ 'MENU.SETTINGS' | translate }}</span>

View File

@ -78,6 +78,8 @@ export class OwnedProjectDetailComponent implements OnInit {
const { id } = params; const { id } = params;
if (id) { if (id) {
this.currentSetting = id; this.currentSetting = id;
} else {
this.currentSetting = 'general';
} }
}); });
} }

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AuthConfig, OAuthService } from 'angular-oauth2-oidc'; import { AuthConfig, OAuthService } from 'angular-oauth2-oidc';
import { BehaviorSubject, from, Observable } from 'rxjs'; import { BehaviorSubject, from, lastValueFrom, Observable } from 'rxjs';
import { StatehandlerService } from './statehandler/statehandler.service'; import { StatehandlerService } from './statehandler/statehandler.service';
@ -41,7 +41,7 @@ export class AuthenticationService {
this._authenticated = this.oauthService.hasValidAccessToken(); this._authenticated = this.oauthService.hasValidAccessToken();
if (!this.oauthService.hasValidIdToken() || !this.authenticated || partialConfig || force) { if (!this.oauthService.hasValidIdToken() || !this.authenticated || partialConfig || force) {
const newState = await this.statehandler.createState().toPromise(); const newState = await lastValueFrom(this.statehandler.createState());
this.oauthService.initCodeFlow(newState); this.oauthService.initCodeFlow(newState);
} }
this._authenticationChanged.next(this.authenticated); this._authenticationChanged.next(this.authenticated);

View File

@ -16,9 +16,7 @@ export class StatehandlerProcessorServiceImpl implements StatehandlerProcessorSe
const externalUrl = this.location.prepareExternalUrl(url); const externalUrl = this.location.prepareExternalUrl(url);
const urlId = uuidv4(); const urlId = uuidv4();
if (externalUrl.includes('login_hint=')) { sessionStorage.setItem(urlId, externalUrl);
sessionStorage.setItem(urlId, externalUrl);
}
return of(urlId); return of(urlId);
} }