Compare commits

...

2 commits

Author SHA1 Message Date
01390583b2
prepare release v3.22.0 2023-12-14 19:25:57 +01:00
3ac5284583
[core] Fix: Properly handle channels without credentials
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-12-14 16:49:33 +01:00
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,15 @@
# 3.22.0 / 2023-12-14
* Improvements
* [editor] Display clear warning when ext perms are missing
* [eventsub] Make topic subscriptions more dynamic
* Bugfixes
* [core] Fix: Properly handle channels without credentials
* [eventsub] Fix: Clean IPs from eventsub-socket read errors
* [eventsub] Update field naming for ad-break, use V1 event
* [twitch] Fix: Log correct error when wiping token fails
# 3.21.0 / 2023-12-09 # 3.21.0 / 2023-12-09
* Improvements * Improvements

View file

@ -172,6 +172,13 @@ func (s Service) GetTwitchClientForChannel(channel string, cfg ClientConfig) (*t
return nil, errors.Wrap(err, "decrypting refresh token") return nil, errors.Wrap(err, "decrypting refresh token")
} }
if perm.AccessToken == "" && perm.RefreshToken == "" {
// We have no tokens but an entry in the permission table: Means
// we still can't do stuff on behalf of that channel so we treat
// that as an unauthorized channel
return nil, ErrChannelNotAuthorized
}
scopes := strings.Split(perm.Scopes, " ") scopes := strings.Split(perm.Scopes, " ")
tc := twitch.New(cfg.TwitchClient, cfg.TwitchClientSecret, perm.AccessToken, perm.RefreshToken) tc := twitch.New(cfg.TwitchClient, cfg.TwitchClientSecret, perm.AccessToken, perm.RefreshToken)