merge main into dev
This commit is contained in:
commit
35d3ce5c5d
31 changed files with 423 additions and 174 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"arimelody-web/global"
|
||||
|
@ -16,7 +15,7 @@ const API_ENDPOINT = "https://discord.com/api/v10"
|
|||
|
||||
var CREDENTIALS_PROVIDED = true
|
||||
var CLIENT_ID = func() string {
|
||||
id := os.Getenv("DISCORD_CLIENT")
|
||||
id := global.Config.Discord.ClientID
|
||||
if id == "" {
|
||||
// fmt.Printf("WARN: Discord client ID (DISCORD_CLIENT) was not provided.\n")
|
||||
CREDENTIALS_PROVIDED = false
|
||||
|
@ -24,14 +23,14 @@ var CLIENT_ID = func() string {
|
|||
return id
|
||||
}()
|
||||
var CLIENT_SECRET = func() string {
|
||||
secret := os.Getenv("DISCORD_SECRET")
|
||||
secret := global.Config.Discord.Secret
|
||||
if secret == "" {
|
||||
// fmt.Printf("WARN: Discord secret (DISCORD_SECRET) was not provided.\n")
|
||||
CREDENTIALS_PROVIDED = false
|
||||
}
|
||||
return secret
|
||||
}()
|
||||
var OAUTH_CALLBACK_URI = fmt.Sprintf("%s/admin/login", global.HTTP_DOMAIN)
|
||||
var OAUTH_CALLBACK_URI = fmt.Sprintf("%s/admin/login", global.Config.BaseUrl)
|
||||
var REDIRECT_URI = fmt.Sprintf("https://discord.com/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&scope=identify", CLIENT_ID, OAUTH_CALLBACK_URI)
|
||||
|
||||
type (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue