From 897fc54103b8731a5007bd5e95f8049d5f5d4a7b 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.js | 4 ++++ src/matrix/net/OidcApi.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/domain/navigation/URLRouter.js b/src/domain/navigation/URLRouter.js index 5f521040..6620e8c9 100644 --- a/src/domain/navigation/URLRouter.js +++ b/src/domain/navigation/URLRouter.js @@ -129,6 +129,10 @@ export class URLRouter { return window.location.origin; } + absoluteAppUrl() { + return window.location.origin; + } + absoluteUrlForAsset(asset) { 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()],