mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-02 00:48:52 +00:00
feat(console): refresh toggle out of granttype context (#1785)
* refresh toggle * disable if not code flow, lint * lint * fix: change oidc config order * accept refresh option within flow Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
769fb93506
commit
1f41cc5ca8
@@ -3,6 +3,7 @@ import { Location } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
@@ -112,6 +113,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
public OIDCAuthMethodType: any = OIDCAuthMethodType;
|
||||
public APIAuthMethodType: any = APIAuthMethodType;
|
||||
public OIDCTokenType: any = OIDCTokenType;
|
||||
public OIDCGrantType: any = OIDCGrantType;
|
||||
|
||||
public ChangeType: any = ChangeType;
|
||||
|
||||
@@ -439,6 +441,24 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public toggleRefreshToken(event: MatCheckboxChange): void {
|
||||
const c = this.grantTypesList?.value;
|
||||
|
||||
if (event.checked) {
|
||||
if (!c.includes(OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN)) {
|
||||
this.grantTypesList?.setValue([OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN, ...c]);
|
||||
}
|
||||
} else {
|
||||
const index = (this.grantTypesList?.value as OIDCGrantType[])
|
||||
.findIndex(gt => gt === OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN);
|
||||
if (index > -1) {
|
||||
const copy = Object.assign([], this.grantTypesList?.value);
|
||||
copy.splice(index, 1);
|
||||
this.grantTypesList?.setValue(copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public saveOIDCApp(): void {
|
||||
this.requestRedirectValuesSubject$.next();
|
||||
|
||||
Reference in New Issue
Block a user