Possibility to configure an OpenID Connect provider on the instance level WIP (#128).

This commit is contained in:
John Livingston
2024-04-16 17:18:14 +02:00
parent e646ebfd69
commit 669b260307
11 changed files with 158 additions and 24 deletions

View File

@ -77,13 +77,24 @@ async function getConverseJSParams (
roomJID
} = connectionInfos
const oidc = ExternalAuthOIDC.singleton()
// TODO:
const externalAuthOIDC = await oidc.isOk()
? {
buttonLabel: oidc.getButtonLabel() ?? '???'
let externalAuthOIDC
if (userIsConnected !== true) {
try {
const oidc = ExternalAuthOIDC.singleton()
if (await oidc.isOk()) {
const authUrl = oidc.getAuthUrl()
const buttonLabel = oidc.getButtonLabel()
if (authUrl && buttonLabel) {
externalAuthOIDC = {
buttonLabel: buttonLabel,
url: authUrl
}
}
}
: undefined
} catch (err) {
options.peertubeHelpers.logger.error(err)
}
}
return {
peertubeVideoOriginalUrl: roomInfos.video?.url,