UI: Add Auth and OAuth classes

Allows the ability to authenticate to a specific service.  Typically via
OAuth.
This commit is contained in:
jp9000
2019-02-07 14:47:15 -08:00
parent 1b8bc55f6a
commit 08fb29a035
10 changed files with 543 additions and 4 deletions
+10
View File
@@ -232,7 +232,9 @@ bool OBSBasic::AddProfile(bool create_new, const char *title, const char *text,
config_set_string(App()->GlobalConfig(), "Basic", "ProfileDir",
newDir.c_str());
Auth::Save();
if (create_new) {
auth.reset();
DestroyPanelCookieManager();
} else if (!rename) {
DuplicateCurrentCookieProfile(config);
@@ -456,6 +458,8 @@ void OBSBasic::on_actionRemoveProfile_triggered()
config_set_string(App()->GlobalConfig(), "Basic", "ProfileDir",
newDir);
Auth::Save();
auth.reset();
DestroyPanelCookieManager();
config.Swap(basicConfig);
@@ -471,6 +475,8 @@ void OBSBasic::on_actionRemoveProfile_triggered()
UpdateTitleBar();
Auth::Load();
if (api) {
api->on_event(OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED);
api->on_event(OBS_FRONTEND_EVENT_PROFILE_CHANGED);
@@ -615,6 +621,8 @@ void OBSBasic::ChangeProfile()
config_set_string(App()->GlobalConfig(), "Basic", "ProfileDir",
newDir);
Auth::Save();
auth.reset();
DestroyPanelCookieManager();
config.Swap(basicConfig);
@@ -624,6 +632,8 @@ void OBSBasic::ChangeProfile()
config_save_safe(App()->GlobalConfig(), "tmp", nullptr);
UpdateTitleBar();
Auth::Load();
CheckForSimpleModeX264Fallback();
blog(LOG_INFO, "Switched to profile '%s' (%s)",