Authentication token generation (#98):

* setting to disable the feature (aka "panic button")
This commit is contained in:
John Livingston
2024-06-17 15:21:22 +02:00
parent a9b6474b8f
commit 257fdbd2c2
7 changed files with 111 additions and 30 deletions

View File

@ -18,6 +18,7 @@ export type LiveChatSettings = SettingEntries & {
'prosody-room-allow-s2s': boolean
'converse-theme': ConverseJSTheme
'prosody-room-type': string
'livechat-token-disabled': boolean
}
export class PtContext {

View File

@ -111,7 +111,12 @@ export class ShareChatElement extends LivechatElement {
// Note: for dockEnabled, we check:
// * that the user is logged in
// * that the video is local (for remote video, tests case are too complicated, and it's not the main use case, so…)
this.dockEnabled = !isAnonymousUser(this.ptContext.ptOptions) && this._video.isLocal
// * settings is not disabled
this.dockEnabled = (
!isAnonymousUser(this.ptContext.ptOptions) &&
this._video.isLocal &&
!settings['livechat-token-disabled']
)
this.autocolorsAvailable = isAutoColorsAvailable(settings['converse-theme'])
this._restorePreviousState()