mirror of
https://github.com/goharbor/harbor
synced 2025-05-21 18:12:22 +00:00
Merge pull request #7317 from jwangyangls/oidcRedirectToHarbor
Add OIDC onboard page redirect to Harbor url when we login from OIDC
This commit is contained in:
commit
a8ff6aa934
@ -3,7 +3,7 @@
|
||||
<form #signInForm="ngForm" class="login">
|
||||
<label class="title"> {{customAppTitle? customAppTitle:(appTitle | translate)}}
|
||||
</label>
|
||||
<a href="/c/oidc/login" class="login-oidc">
|
||||
<a href="/c/oidc/login" class="login-oidc" *ngIf="isOidcLoginMode">
|
||||
<button type="button" id="log_oidc" class="btn btn-primary btn-block">
|
||||
<span>{{'BUTTON.LOG_IN_OIDC' | translate }}</span>
|
||||
</button>
|
||||
|
@ -60,6 +60,6 @@
|
||||
background:transparent;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
margin-bottom: 50px;
|
||||
.login-oidc{
|
||||
margin-top: 50px;
|
||||
}
|
@ -141,11 +141,12 @@ export class SignInComponent implements AfterViewChecked, OnInit {
|
||||
return this.appConfig.auth_mode === 'db_auth'
|
||||
&& this.appConfig.self_registration;
|
||||
}
|
||||
|
||||
public get isOidcLoginMode(): boolean {
|
||||
return this.appConfig.auth_mode === 'oidc_auth';
|
||||
}
|
||||
public get showForgetPwd(): boolean {
|
||||
return this.appConfig.auth_mode !== 'ldap_auth' && this.appConfig.auth_mode !== 'uaa_auth';
|
||||
}
|
||||
|
||||
clickRememberMe($event: any): void {
|
||||
if ($event && $event.target) {
|
||||
this.rememberMe = $event.target.checked;
|
||||
|
@ -14,7 +14,8 @@
|
||||
import { Component, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Router, NavigationExtras } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
// import { map } from 'rxjs/operators';
|
||||
import { PlatformLocation } from '@angular/common';
|
||||
import { ModalEvent } from '../modal-event';
|
||||
import { modalEvents } from '../modal-events.const';
|
||||
|
||||
@ -46,6 +47,7 @@ export class NavigatorComponent implements OnInit {
|
||||
constructor(
|
||||
private session: SessionService,
|
||||
private router: Router,
|
||||
private location: PlatformLocation,
|
||||
private translate: TranslateService,
|
||||
private cookie: CookieService,
|
||||
private appConfigService: AppConfigService,
|
||||
@ -147,8 +149,10 @@ export class NavigatorComponent implements OnInit {
|
||||
logOut(): void {
|
||||
// Naviagte to the sign in route
|
||||
// Appending 'signout' means destroy session cache
|
||||
let signout = true;
|
||||
let redirect_url = this.location.pathname;
|
||||
let navigatorExtra: NavigationExtras = {
|
||||
queryParams: { "signout": true }
|
||||
queryParams: {signout, redirect_url}
|
||||
};
|
||||
this.router.navigate([CommonRoutes.EMBEDDED_SIGN_IN], navigatorExtra);
|
||||
// Confirm search result panel is close
|
||||
|
@ -28,7 +28,9 @@ export class OidcOnboardComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
clickSaveBtn(): void {
|
||||
this.oidcOnboardService.oidcSave({ username: this.oidcUsername.value }).subscribe(res => { }
|
||||
this.oidcOnboardService.oidcSave({ username: this.oidcUsername.value }).subscribe(res => {
|
||||
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
||||
}
|
||||
, error => {
|
||||
this.errorMessage = errorHandler(error);
|
||||
this.errorOpen = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user