From 27e17bd82e3e19f7a9c7987ce38f9f91ff8c6016 Mon Sep 17 00:00:00 2001 From: Martin Thielecke Date: Sat, 9 May 2020 22:39:27 +0200 Subject: [PATCH] make redirect url configurable --- settings.go | 3 ++- settings.yml.dist | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/settings.go b/settings.go index 2232cda..2d9e38d 100644 --- a/settings.go +++ b/settings.go @@ -19,6 +19,7 @@ var ( type Settings struct { ClientID string `yaml:"client_id"` ClientSecret string `yaml:"client_secret"` + RedirectURL string `yaml:"redirect_Url"` VerificationToken string `yaml:"verification_token"` WebserverPort string `yaml:"webserver_port"` } @@ -40,7 +41,7 @@ func loadSettings() { settings = s twitchOauthConfig = &oauth2.Config{ - RedirectURL: "http://localhost:8080/callback", + RedirectURL: settings.RedirectURL, ClientID: settings.ClientID, ClientSecret: settings.ClientSecret, Scopes: []string{"channel:read:subscriptions", "user:read:broadcast", "chat:read", "chat:edit", "channel_read", "channel_editor", "channel_subscriptions", "channel:moderate", "bits:read", "channel:read:redemptions"}, diff --git a/settings.yml.dist b/settings.yml.dist index d95861d..fedafb7 100644 --- a/settings.yml.dist +++ b/settings.yml.dist @@ -2,3 +2,4 @@ client_id: "your twitch client id" client_secret: "your twitch client secret" verification_token: "a random string!" webserver_port: 8080 +redirect_url: "http://localhost:8080/callback",