UI: Implement DeleteCookies for YT Service dock

This will enable centralized cookie management for YouTube/Google
account logins for other browser docks using the shared cookie manager.
This commit is contained in:
Suman Manjunath 2024-05-17 16:43:19 +00:00
parent 8892edde05
commit 78e112df46

View file

@ -55,6 +55,14 @@ static inline void OpenBrowser(const QString auth_uri)
QDesktopServices::openUrl(url);
}
static void DeleteCookies()
{
if (panel_cookies) {
panel_cookies->DeleteCookies("youtube.com", std::string());
panel_cookies->DeleteCookies("google.com", std::string());
}
}
void RegisterYoutubeAuth()
{
for (auto &service : youtubeServices) {
@ -64,7 +72,7 @@ void RegisterYoutubeAuth()
return std::make_shared<YoutubeApiWrappers>(
service);
},
YoutubeAuth::Login, []() { return; });
YoutubeAuth::Login, DeleteCookies);
}
}