add more logs
This commit is contained in:
parent
5a9d44c8ff
commit
037f1f4132
3
auth.go
3
auth.go
@ -6,6 +6,7 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
@ -47,6 +48,7 @@ func getLoginCallback(c *gin.Context) {
|
|||||||
|
|
||||||
token, err := discordConf.Exchange(context.Background(), c.Query("code"))
|
token, err := discordConf.Exchange(context.Background(), c.Query("code"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{
|
c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{
|
||||||
"errorMessage": "Failed to exchange code for token",
|
"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")
|
res, err := discordConf.Client(context.Background(), token).Get("https://discord.com/api/users/@me")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{
|
c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{
|
||||||
"errorMessage": "Failed to get user details from Discord",
|
"errorMessage": "Failed to get user details from Discord",
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user