mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 13:59:53 +01:00
Secret
This commit is contained in:
2
klotz.go
2
klotz.go
@@ -5,11 +5,13 @@ import "time"
|
||||
type UserData struct {
|
||||
Username string `json:"username"`
|
||||
MalId int `json:"malId"`
|
||||
Secret string `json:"secret"`
|
||||
}
|
||||
|
||||
type RegisterData struct {
|
||||
Username string `json:"username"`
|
||||
MalId int `json:"malId"`
|
||||
Secret string `json:"secret"`
|
||||
Sauce string `json:"sauce"`
|
||||
}
|
||||
|
||||
|
||||
3
ober.go
3
ober.go
@@ -75,7 +75,7 @@ func Register(ctx *fasthttp.RequestCtx) {
|
||||
ctx.SetStatusCode(fasthttp.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if register.MalId == 0 || register.Username == "" || register.Sauce == "" {
|
||||
if register.MalId == 0 || register.Username == "" || register.Secret == "" || register.Sauce == "" {
|
||||
ctx.WriteString("Sprich JSON du Hurensohn")
|
||||
ctx.SetStatusCode(fasthttp.StatusBadRequest)
|
||||
return
|
||||
@@ -109,6 +109,7 @@ func Register(ctx *fasthttp.RequestCtx) {
|
||||
user := UserData{
|
||||
Username: register.Username,
|
||||
MalId: register.MalId,
|
||||
Secret: register.Secret,
|
||||
}
|
||||
err = SaveUser(&user)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user