migrate from envars to toml config

This commit is contained in:
ari melody 2024-11-10 05:34:04 +00:00
parent 5284b8a7cc
commit 04f7f97b62
Signed by: ari
GPG key ID: CF99829C92678188
12 changed files with 182 additions and 109 deletions

View file

@ -154,10 +154,6 @@ func LoginHandler() http.Handler {
return
}
fmt.Println(discord.CLIENT_ID)
fmt.Println(discord.API_ENDPOINT)
fmt.Println(discord.REDIRECT_URI)
code := r.URL.Query().Get("code")
if code == "" {
@ -194,7 +190,7 @@ func LoginHandler() http.Handler {
cookie.Name = "token"
cookie.Value = session.Token
cookie.Expires = time.Now().Add(24 * time.Hour)
if strings.HasPrefix(global.HTTP_DOMAIN, "https") {
if strings.HasPrefix(global.Config.BaseUrl, "https") {
cookie.Secure = true
}
cookie.HttpOnly = true