mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
4.51.0
This is the first release built with the updated build toolchain. Please let me know if you find anything unexpected that broke. * Added: Setting to treat known usernames in chat as mentions even without an at sign (@) prefix. * Added: Setting to automatically claim drops. * Added: Setting to hide the Subtember banner. * Changed: The stream latency metadata tool-tip now includes the buffer size value. * Fixed: The stream latency metadata was not appearing on the new mod view layout. * Fixed: The sub/bits leaderboard appearing in chat when it should be hidden by a setting. * Fixed: Incorrect text color on the Subtember banner.
This commit is contained in:
parent
10ca28098b
commit
588d3e3da9
13 changed files with 243 additions and 11 deletions
|
@ -36,6 +36,31 @@ export default class SocketClient extends Module {
|
|||
getSocket: () => this,
|
||||
});
|
||||
|
||||
this.settings.add('auth.mode', {
|
||||
default: 'chat',
|
||||
|
||||
ui: {
|
||||
path: 'Data Management > Authentication >> General',
|
||||
title: 'Authentication Provider',
|
||||
description: 'Which method should the FrankerFaceZ client use to authenticate against the FFZ servers when necessary?',
|
||||
component: 'setting-select-box',
|
||||
force_seen: true,
|
||||
|
||||
data: [
|
||||
{
|
||||
value: 'chat',
|
||||
title: 'Twitch Chat'
|
||||
},
|
||||
{
|
||||
value: false,
|
||||
title: 'Disabled (No Authentication)'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
changed: () => this._cached_token = null
|
||||
});
|
||||
|
||||
this.settings.add('socket.use-cluster', {
|
||||
default: 'Production',
|
||||
|
||||
|
@ -135,6 +160,15 @@ export default class SocketClient extends Module {
|
|||
// ========================================================================
|
||||
|
||||
getAPIToken() {
|
||||
const mode = this.settings.get('auth.mode');
|
||||
|
||||
if ( mode === 'chat' )
|
||||
return this._getAPIToken_Chat();
|
||||
|
||||
return Promise.reject(new Error('The user has disabled authentication.'));
|
||||
}
|
||||
|
||||
_getAPIToken_Chat() {
|
||||
if ( this._cached_token ) {
|
||||
if ( this._cached_token.expires > (Date.now() + 15000) )
|
||||
return Promise.resolve(this._cached_token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue