fix: Add return statement in whoami method if token is unknown

(Fixes #4)
This commit is contained in:
ChronosX88 2019-07-30 15:45:47 +04:00
parent d96df1b1e5
commit ef06534124
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -168,6 +168,7 @@ func WhoAmIHandler(w http.ResponseWriter, r *http.Request) {
user := currServer.Backend.GetUserByToken(token)
if user == nil {
errorResponse(w, models.M_UNKNOWN_TOKEN, http.StatusForbidden, "")
return
}
response := whoami.Response{UserID: user.ID()}