Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add webauthn to keycloak + link to settings page #9

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// eslint-disable-next-line @typescript-eslint/no-namespace
export declare namespace globalThis {
let environment: {
backendUrl: string;
keycloakHost: string;
keycloakClient: string;
keycloakRealm: string;
demoIssuer: string;
demoVerifier: string;
};
}

export const environment = {
backendUrl: 'http://localhost:3000',
keycloakHost: 'http://localhost:8080',
Expand All @@ -6,3 +18,5 @@ export const environment = {
demoIssuer: 'http://localhost:3001',
demoVerifier: 'http://localhost:3002',
};

globalThis.environment = environment;
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
>Automate issuance and verify process</mat-slide-toggle
>
</mat-list-item>
<mat-list-item>
<a [href]="keycloakLink" target="_blank">Update password</a>
</mat-list-item>
<mat-list-item>
<button mat-button (click)="authService.logout()">Logout</button>
</mat-list-item>
Expand Down
14 changes: 14 additions & 0 deletions apps/holder/projects/shared/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ import { HttpClient, HttpClientModule } from '@angular/common/http';
import { firstValueFrom } from 'rxjs';
import { SettingsApiService } from '../api/kms';

// eslint-disable-next-line @typescript-eslint/no-namespace
export declare namespace globalThis {
let environment: {
backendUrl: string;
keycloakHost: string;
keycloakClient: string;
keycloakRealm: string;
demoIssuer: string;
demoVerifier: string;
};
}

@Component({
selector: 'app-settings',
standalone: true,
Expand All @@ -26,6 +38,7 @@ import { SettingsApiService } from '../api/kms';
})
export class SettingsComponent implements OnInit {
automateControl!: FormControl<boolean | null>;
keycloakLink: string;

constructor(
public authService: AuthService,
Expand All @@ -34,6 +47,7 @@ export class SettingsComponent implements OnInit {
private settingsApiService: SettingsApiService
) {
this.automateControl = new FormControl();
this.keycloakLink = `${globalThis.environment.keycloakHost}/realms/${globalThis.environment.keycloakRealm}/account`;
}

async ngOnInit(): Promise<void> {
Expand Down
Loading