diff --git a/controllers/auth.go b/controllers/auth.go index 041ddfb..84f35e3 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -47,7 +47,7 @@ func Auth(c *fiber.Ctx) error { } //err = c.RedirectToRoute("index", fiber.Map{"auth": "ok"}) - err = c.Redirect("/?test") + err = c.Redirect("/") return err //return c.SendStatus(fiber.StatusOK) //return err diff --git a/go.mod b/go.mod index 5bebf92..3477d61 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,11 @@ go 1.19 require ( github.com/gofiber/fiber/v2 v2.38.1 - github.com/gofiber/swagger v0.1.2 - github.com/gofiber/template v1.7.1 + github.com/gofiber/swagger v0.1.6 github.com/joho/godotenv v1.4.0 github.com/markbates/goth v1.73.0 github.com/shareed2k/goth_fiber v0.2.8 - github.com/swaggo/swag v1.8.5 + github.com/swaggo/swag v1.8.6 go.mongodb.org/mongo-driver v1.10.3 ) @@ -24,6 +23,7 @@ require ( github.com/go-openapi/swag v0.19.15 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.3 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/securecookie v1.1.1 // indirect @@ -33,7 +33,7 @@ require ( github.com/mailru/easyjson v0.7.6 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect + github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.40.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect @@ -50,5 +50,6 @@ require ( golang.org/x/tools v0.1.10 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/models/user.go b/models/user.go index 6dffe04..c35d5ea 100644 --- a/models/user.go +++ b/models/user.go @@ -3,17 +3,17 @@ package models import "go.mongodb.org/mongo-driver/bson/primitive" type User struct { - Id primitive.ObjectID `bson:"_id", omitempty` - Banned bool `bson:banned` - BlackLister bool `bson:"blacklisted"` - Experience uint `bson:"experience"` + Id primitive.ObjectID `bson:"_id" json:"id", omitempty` + Banned bool `bson:"banned" json:"banned"` + BlackLister bool `bson:"blacklisted" json:"blacklisted"` + Experience uint `bson:"experience" json:"experience"` //LastBuy string `bson:"lastBuy,omitempty"` - Level uint `bson:"level"` - Money uint `bson:"money"` - MoneyLimit uint `bson:"moneyLimit"` - DiscordId string `bson:"userId,omitempty"` - SteamId string `bson:"steamId,omitempty"` - DiscordName string `bson:"username,omitempty"` + Level uint `bson:"level" json:"level"` + Money uint `bson:"money" json:"money"` + MoneyLimit uint `bson:"moneyLimit" json:"moneylimit"` + DiscordId string `bson:"userId,omitempty" json:"userid"` + SteamId string `bson:"steamId,omitempty" json:"steamid"` + DiscordName string `bson:"username,omitempty" json:"discordname"` } func NewUser() *User {