UI: Make OAuth base URL configurable

master
derrod 2022-04-03 17:48:02 +02:00 committed by Jim
parent 73e6df5d09
commit 5dcabaf5cf
5 changed files with 15 additions and 6 deletions

View File

@ -26,6 +26,12 @@ if(TARGET obs-browser
obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
endif()
set(OAUTH_BASE_URL
"https://auth.obsproject.com/"
CACHE STRING "Default OAuth base URL")
mark_as_advanced(OAUTH_BASE_URL)
if(NOT DEFINED TWITCH_CLIENTID
OR "${TWITCH_CLIENTID}" STREQUAL ""
OR NOT DEFINED TWITCH_HASH

View File

@ -14,6 +14,8 @@
#include <json11.hpp>
#include "ui-config.h"
using namespace json11;
#ifdef BROWSER_AVAILABLE
@ -93,7 +95,7 @@ void OAuthLogin::urlChanged(const QString &url)
if (code_idx == -1)
return;
if (url.left(22) != "https://obsproject.com")
if (!url.startsWith(OAUTH_BASE_URL))
return;
code_idx += (int)uri.size();

View File

@ -19,9 +19,8 @@ using namespace json11;
/* ------------------------------------------------------------------------- */
#define RESTREAM_AUTH_URL \
"https://obsproject.com/app-auth/restream?action=redirect"
#define RESTREAM_TOKEN_URL "https://obsproject.com/app-auth/restream-token"
#define RESTREAM_AUTH_URL OAUTH_BASE_URL "v1/restream/redirect"
#define RESTREAM_TOKEN_URL OAUTH_BASE_URL "v1/restream/token"
#define RESTREAM_STREAMKEY_URL "https://api.restream.io/v2/user/streamKey"
#define RESTREAM_SCOPE_VERSION 1

View File

@ -22,8 +22,8 @@ using namespace json11;
/* ------------------------------------------------------------------------- */
#define TWITCH_AUTH_URL "https://obsproject.com/app-auth/twitch?action=redirect"
#define TWITCH_TOKEN_URL "https://obsproject.com/app-auth/twitch-token"
#define TWITCH_AUTH_URL OAUTH_BASE_URL "v1/twitch/redirect"
#define TWITCH_TOKEN_URL OAUTH_BASE_URL "v1/twitch/token"
#define TWITCH_SCOPE_VERSION 1

View File

@ -18,6 +18,8 @@
#cmakedefine USE_XDG
#define OAUTH_BASE_URL "@OAUTH_BASE_URL@"
#define TWITCH_ENABLED @TWITCH_ENABLED@
#define TWITCH_CLIENTID "@TWITCH_CLIENTID@"
#define TWITCH_HASH 0x@TWITCH_HASH@