Skip to content

Commit

Permalink
Merge pull request #9 from cre8/fix/webauthn
Browse files Browse the repository at this point in the history
add webauthn to keycloak + link to settings page
  • Loading branch information
cre8 authored Apr 30, 2024
2 parents 964695b + a71a8a0 commit bbd1e09
Show file tree
Hide file tree
Showing 5 changed files with 679 additions and 403 deletions.
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;
3 changes: 3 additions & 0 deletions apps/holder/projects/shared/settings/settings.component.html
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

0 comments on commit bbd1e09

Please sign in to comment.