UI: Make OAuth base URL configurable
parent
73e6df5d09
commit
5dcabaf5cf
|
@ -26,6 +26,12 @@ if(TARGET obs-browser
|
||||||
obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
|
obs-browser-panels INTERFACE ${CMAKE_SOURCE_DIR}/plugins/obs-browser/panel)
|
||||||
endif()
|
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
|
if(NOT DEFINED TWITCH_CLIENTID
|
||||||
OR "${TWITCH_CLIENTID}" STREQUAL ""
|
OR "${TWITCH_CLIENTID}" STREQUAL ""
|
||||||
OR NOT DEFINED TWITCH_HASH
|
OR NOT DEFINED TWITCH_HASH
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include <json11.hpp>
|
#include <json11.hpp>
|
||||||
|
|
||||||
|
#include "ui-config.h"
|
||||||
|
|
||||||
using namespace json11;
|
using namespace json11;
|
||||||
|
|
||||||
#ifdef BROWSER_AVAILABLE
|
#ifdef BROWSER_AVAILABLE
|
||||||
|
@ -93,7 +95,7 @@ void OAuthLogin::urlChanged(const QString &url)
|
||||||
if (code_idx == -1)
|
if (code_idx == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (url.left(22) != "https://obsproject.com")
|
if (!url.startsWith(OAUTH_BASE_URL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
code_idx += (int)uri.size();
|
code_idx += (int)uri.size();
|
||||||
|
|
|
@ -19,9 +19,8 @@ using namespace json11;
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#define RESTREAM_AUTH_URL \
|
#define RESTREAM_AUTH_URL OAUTH_BASE_URL "v1/restream/redirect"
|
||||||
"https://obsproject.com/app-auth/restream?action=redirect"
|
#define RESTREAM_TOKEN_URL OAUTH_BASE_URL "v1/restream/token"
|
||||||
#define RESTREAM_TOKEN_URL "https://obsproject.com/app-auth/restream-token"
|
|
||||||
#define RESTREAM_STREAMKEY_URL "https://api.restream.io/v2/user/streamKey"
|
#define RESTREAM_STREAMKEY_URL "https://api.restream.io/v2/user/streamKey"
|
||||||
#define RESTREAM_SCOPE_VERSION 1
|
#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_AUTH_URL OAUTH_BASE_URL "v1/twitch/redirect"
|
||||||
#define TWITCH_TOKEN_URL "https://obsproject.com/app-auth/twitch-token"
|
#define TWITCH_TOKEN_URL OAUTH_BASE_URL "v1/twitch/token"
|
||||||
|
|
||||||
#define TWITCH_SCOPE_VERSION 1
|
#define TWITCH_SCOPE_VERSION 1
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#cmakedefine USE_XDG
|
#cmakedefine USE_XDG
|
||||||
|
|
||||||
|
#define OAUTH_BASE_URL "@OAUTH_BASE_URL@"
|
||||||
|
|
||||||
#define TWITCH_ENABLED @TWITCH_ENABLED@
|
#define TWITCH_ENABLED @TWITCH_ENABLED@
|
||||||
#define TWITCH_CLIENTID "@TWITCH_CLIENTID@"
|
#define TWITCH_CLIENTID "@TWITCH_CLIENTID@"
|
||||||
#define TWITCH_HASH 0x@TWITCH_HASH@
|
#define TWITCH_HASH 0x@TWITCH_HASH@
|
||||||
|
|
Loading…
Reference in New Issue