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