From 037f1f4132e265ddd3c68556891e3cb06dac4b0d Mon Sep 17 00:00:00 2001 From: Erikas Date: Fri, 5 Jul 2024 00:30:52 +0300 Subject: [PATCH] add more logs --- auth.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/auth.go b/auth.go index af2fbc5..e654be8 100644 --- a/auth.go +++ b/auth.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "encoding/json" "io" + "log" "net/http" "github.com/gin-contrib/sessions" @@ -47,6 +48,7 @@ func getLoginCallback(c *gin.Context) { token, err := discordConf.Exchange(context.Background(), c.Query("code")) if err != nil { + log.Println(err) c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{ "errorMessage": "Failed to exchange code for token", }) @@ -55,6 +57,7 @@ func getLoginCallback(c *gin.Context) { res, err := discordConf.Client(context.Background(), token).Get("https://discord.com/api/users/@me") if err != nil { + log.Println(err) c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{ "errorMessage": "Failed to get user details from Discord", })