UI: Make OAuth base URL configurable
This commit is contained in:
parent
73e6df5d09
commit
5dcabaf5cf
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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@
|
||||
|
Loading…
x
Reference in New Issue
Block a user