make redirect url configurable
This commit is contained in:
parent
0cd4efc8d8
commit
27e17bd82e
|
@ -19,6 +19,7 @@ var (
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
ClientID string `yaml:"client_id"`
|
ClientID string `yaml:"client_id"`
|
||||||
ClientSecret string `yaml:"client_secret"`
|
ClientSecret string `yaml:"client_secret"`
|
||||||
|
RedirectURL string `yaml:"redirect_Url"`
|
||||||
VerificationToken string `yaml:"verification_token"`
|
VerificationToken string `yaml:"verification_token"`
|
||||||
WebserverPort string `yaml:"webserver_port"`
|
WebserverPort string `yaml:"webserver_port"`
|
||||||
}
|
}
|
||||||
|
@ -40,7 +41,7 @@ func loadSettings() {
|
||||||
settings = s
|
settings = s
|
||||||
|
|
||||||
twitchOauthConfig = &oauth2.Config{
|
twitchOauthConfig = &oauth2.Config{
|
||||||
RedirectURL: "http://localhost:8080/callback",
|
RedirectURL: settings.RedirectURL,
|
||||||
ClientID: settings.ClientID,
|
ClientID: settings.ClientID,
|
||||||
ClientSecret: settings.ClientSecret,
|
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"},
|
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"},
|
||||||
|
|
|
@ -2,3 +2,4 @@ client_id: "your twitch client id"
|
||||||
client_secret: "your twitch client secret"
|
client_secret: "your twitch client secret"
|
||||||
verification_token: "a random string!"
|
verification_token: "a random string!"
|
||||||
webserver_port: 8080
|
webserver_port: 8080
|
||||||
|
redirect_url: "http://localhost:8080/callback",
|
||||||
|
|
Reference in New Issue
Block a user