This commit is contained in:
Dot-Rar 2020-05-16 17:49:19 +01:00
parent 0ddeff754a
commit 10c970b8fb
3 changed files with 1 additions and 9 deletions

View File

@ -80,18 +80,14 @@ func CallbackHandler(ctx *gin.Context) {
var guilds []guild.Guild
err, _ = userEndpoint.CurrentUserGuilds.Request(store, nil, nil, &guilds)
log.Info("1")
log.Infof("size: %d", len(guilds))
if err != nil {
log.Error(err.Error())
handleRedirect(ctx)
return
}
log.Info("2")
store.Set("has_guilds", true)
store.Save()
log.Info("3")
var wrappedGuilds []database.UserGuild
@ -110,8 +106,6 @@ func CallbackHandler(ctx *gin.Context) {
UserPermissions: int32(guild.Permissions),
})
}
log.Info("4")
log.Infof("size wrapped: %d", len(wrappedGuilds))
if err := dbclient.Client.UserGuilds.Set(currentUser.Id, wrappedGuilds); err != nil {
log.Error(err.Error())

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.14
require (
github.com/BurntSushi/toml v0.3.1
github.com/TicketsBot/archiverclient v0.0.0-20200425115930-0ca198cc8306
github.com/TicketsBot/database v0.0.0-20200516145701-e13f7e204cc6
github.com/TicketsBot/database v0.0.0-20200516164834-2b61e9fa9b5a
github.com/apex/log v1.1.2
github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible

View File

@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"github.com/TicketsBot/GoPanel/config"
"github.com/apex/log"
"github.com/gin-gonic/contrib/sessions"
"github.com/pasztorpisti/qs"
"github.com/pkg/errors"
@ -118,6 +117,5 @@ func (e *Endpoint) Request(store sessions.Session, contentType *ContentType, bod
return err, nil
}
log.Info(string(content))
return json.Unmarshal(content, response), res
}