this is immensely broken but i swear i'll fix it later
This commit is contained in:
parent
e2ec731109
commit
d5f1fcb5e0
28 changed files with 409 additions and 253 deletions
|
@ -15,22 +15,8 @@ import (
|
|||
const API_ENDPOINT = "https://discord.com/api/v10"
|
||||
|
||||
var CREDENTIALS_PROVIDED = true
|
||||
var CLIENT_ID = func() string {
|
||||
id := os.Getenv("DISCORD_CLIENT")
|
||||
if id == "" {
|
||||
fmt.Printf("WARN: Discord client ID (DISCORD_CLIENT) was not provided. Admin login will be unavailable.\n")
|
||||
CREDENTIALS_PROVIDED = false
|
||||
}
|
||||
return id
|
||||
}()
|
||||
var CLIENT_SECRET = func() string {
|
||||
secret := os.Getenv("DISCORD_SECRET")
|
||||
if secret == "" {
|
||||
fmt.Printf("WARN: Discord secret (DISCORD_SECRET) was not provided. Admin login will be unavailable.\n")
|
||||
CREDENTIALS_PROVIDED = false
|
||||
}
|
||||
return secret
|
||||
}()
|
||||
var CLIENT_ID = os.Getenv("DISCORD_CLIENT")
|
||||
var CLIENT_SECRET = os.Getenv("DISCORD_SECRET")
|
||||
var OAUTH_CALLBACK_URI = fmt.Sprintf("%s/admin/login", global.HTTP_DOMAIN)
|
||||
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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue