mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-07-08 17:32:21 +02:00
Compare commits
No commits in common. "b51f5cbf692240c8eea54470b73c71f99cef106a" and "f9cce330f6fa3292f85223b717fc7b464911acfc" have entirely different histories.
b51f5cbf69
...
f9cce330f6
@ -479,18 +479,15 @@ func handleSystem(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var active bool
|
if !r.URL.Query().Has("clientSessionId") {
|
||||||
if r.URL.Path != "/savedata/system/verify" {
|
httpError(w, r, fmt.Errorf("missing clientSessionId"), http.StatusBadRequest)
|
||||||
if !r.URL.Query().Has("clientSessionId") {
|
return
|
||||||
httpError(w, r, fmt.Errorf("missing clientSessionId"), http.StatusBadRequest)
|
}
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
active, err = db.IsActiveSession(uuid, r.URL.Query().Get("clientSessionId"))
|
active, err := db.IsActiveSession(uuid, r.URL.Query().Get("clientSessionId"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, r, fmt.Errorf("failed to check active session: %s", err), http.StatusBadRequest)
|
httpError(w, r, fmt.Errorf("failed to check active session: %s", err), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch r.PathValue("action") {
|
switch r.PathValue("action") {
|
||||||
@ -539,24 +536,10 @@ func handleSystem(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusNoContent)
|
w.WriteHeader(http.StatusNoContent)
|
||||||
case "verify":
|
case "verify":
|
||||||
var input SystemVerifyRequest
|
var input SystemVerifyRequest
|
||||||
if !r.URL.Query().Has("clientSessionId") {
|
err = json.NewDecoder(r.Body).Decode(&input)
|
||||||
err = json.NewDecoder(r.Body).Decode(&input)
|
if err != nil {
|
||||||
if err != nil {
|
httpError(w, r, fmt.Errorf("failed to decode request body: %s", err), http.StatusBadRequest)
|
||||||
httpError(w, r, fmt.Errorf("failed to decode request body: %s", err), http.StatusBadRequest)
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
active, err = db.IsActiveSession(uuid, input.ClientSessionId)
|
|
||||||
if err != nil {
|
|
||||||
httpError(w, r, fmt.Errorf("failed to check active session: %s", err), http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
active, err = db.IsActiveSession(uuid, r.URL.Query().Get("clientSessionId"))
|
|
||||||
if err != nil {
|
|
||||||
httpError(w, r, fmt.Errorf("failed to check active session: %s", err), http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
response := SystemVerifyResponse{
|
response := SystemVerifyResponse{
|
||||||
|
Loading…
Reference in New Issue
Block a user