From 7aa7af4adfb1a2d43ec7bfaa6c75743bbeb2718e Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Fri, 29 Apr 2022 16:30:24 +0200 Subject: [PATCH] Add client_uri, tos_uri and policy_uri client metadata --- src/domain/navigation/URLRouter.ts | 4 ++++ src/matrix/net/OidcApi.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/domain/navigation/URLRouter.ts b/src/domain/navigation/URLRouter.ts index ff9dcd76..dbd1ceee 100644 --- a/src/domain/navigation/URLRouter.ts +++ b/src/domain/navigation/URLRouter.ts @@ -156,6 +156,10 @@ export class URLRouter implements IURLRou return window.location.origin; } + absoluteAppUrl(): string { + return window.location.origin; + } + absoluteUrlForAsset(asset: string): string { return (new URL('/assets/' + asset, window.location.origin)).toString(); } diff --git a/src/matrix/net/OidcApi.ts b/src/matrix/net/OidcApi.ts index 319d122f..57168622 100644 --- a/src/matrix/net/OidcApi.ts +++ b/src/matrix/net/OidcApi.ts @@ -78,6 +78,9 @@ export class OidcApi { return { client_name: "Hydrogen Web", logo_uri: this._urlCreator.absoluteUrlForAsset("icon.png"), + client_uri: this._urlCreator.absoluteAppUrl(), + tos_uri: "https://element.io/terms-of-service", + policy_uri: "https://element.io/privacy", response_types: ["code"], grant_types: ["authorization_code", "refresh_token"], redirect_uris: [this._urlCreator.createOIDCRedirectURL()],