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

This commit is contained in:
John Livingston
2024-04-17 18:30:39 +02:00
parent 3a5f27e751
commit 6c13d2e377
9 changed files with 139 additions and 24 deletions

View File

@ -11,7 +11,7 @@ export const tplExternalLoginModal = (el, o) => {
const externalAuthOIDCButtonLabel = api.settings.get('livechat_external_auth_oidc_button_label')
const externalAuthOIDCUrl = api.settings.get('livechat_external_auth_oidc_url')
return html`<div class="modal-body livechat-external-login-modal">
${!externalAuthOIDCButtonLabel || !externalAuthOIDCUrl
${!externalAuthOIDCButtonLabel || !externalAuthOIDCUrl || !window.sessionStorage
? ''
: html`
<div class="livechat-external-login-modal-external-auth-oidc">
@ -45,9 +45,13 @@ export const tplExternalLoginModal = (el, o) => {
(data.message ? ` (${data.message})` : '')
return
}
// TODO
console.info('Got external account information', data)
console.error('not implemented yet')
// Storing the token in sessionStorage.
window.sessionStorage.setItem('peertube-plugin-livechat-oidc-token', data.token)
// FIXME: do better.
window.location.reload()
}
return false