Skip to content

Commit

Permalink
fix: remove custom claims exchange fields (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
mghilardelli authored Feb 7, 2025
1 parent 757b60a commit af83b22
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 61 deletions.
3 changes: 0 additions & 3 deletions webapp/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { AuthService } from "./auth.service";
import { MqService } from "./mq.service";
import { OidcSecurityService, UserDataResult } from "angular-auth-oidc-client";
import { signal } from "@angular/core";
Expand All @@ -10,7 +9,6 @@ import { By } from "@angular/platform-browser";
import { SbbMenuItem } from "@sbb-esta/angular/menu";
import { RouterTestingModule } from "@angular/router/testing";

const mockAuth: Partial<AuthService> = {};
const mockOidc: Partial<OidcSecurityService> = {
userData: signal({userData: {name: 'User'}} as UserDataResult),
logoffLocalMultiple: () => Promise.resolve(true),
Expand All @@ -25,7 +23,6 @@ describe('AppComponent', () => {
await TestBed.configureTestingModule({
imports: [NoopAnimationsModule, RouterTestingModule, SbbIconTestingModule, AppComponent,],
providers: [
{provide: AuthService, useValue: mockAuth},
{provide: OidcSecurityService, useValue: mockOidc},
{provide: MqService, useValue: mockMq},
]
Expand Down
16 changes: 0 additions & 16 deletions webapp/src/app/auth-insights/auth-insights.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,3 @@ <h3 i18n>Claims</h3>
<pre>{{ claims |async | json }}</pre>
<h3 i18n>Scopes</h3>
<pre>{{ scopes |async }}</pre>

<h3 i18n>Exchange token</h3>
<div class="sbb-form-group">
<sbb-form-field>
<sbb-label>ru</sbb-label>
<input type="text" sbbInput [formControl]="ruControl"/>
</sbb-form-field>
<sbb-form-field>
<sbb-label>train</sbb-label>
<input type="text" sbbInput [formControl]="trainControl"/>
</sbb-form-field>
<sbb-form-field>
<sbb-label>role</sbb-label>
<input type="text" sbbInput [formControl]="roleControl"/>
</sbb-form-field>
</div>
10 changes: 0 additions & 10 deletions webapp/src/app/auth-insights/auth-insights.component.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
import { Component } from '@angular/core';
import { CommonModule } from "@angular/common";
import { SbbButtonModule } from "@sbb-esta/angular/button";
import { FormControl, ReactiveFormsModule } from "@angular/forms";
import { map } from "rxjs";
import { OidcSecurityService } from "angular-auth-oidc-client";
import { SbbInputModule } from "@sbb-esta/angular/input";

@Component({
selector: 'app-auth-insights',
standalone: true,
imports: [
CommonModule,
ReactiveFormsModule,
SbbButtonModule,
SbbInputModule,
],
templateUrl: './auth-insights.component.html',
styleUrl: './auth-insights.component.scss'
})
export class AuthInsightsComponent {

ruControl = new FormControl('1088', {nonNullable: true});
trainControl = new FormControl(new Date().toISOString().split('T')[0] + '_9232', {nonNullable: true});
roleControl = new FormControl('read-only', {nonNullable: true});

get claims() {
return this.oidcSecurityService.getUserData();
}
Expand Down
32 changes: 0 additions & 32 deletions webapp/src/app/auth.service.ts

This file was deleted.

0 comments on commit af83b22

Please sign in to comment.