mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-07-18 15:26:01 +08:00
Create new session on password change
This commit is contained in:
parent
f5b0cdb32b
commit
3f648b55e6
@ -134,7 +134,20 @@ func handleAccountChangePW(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
username, err := db.FetchUsernameFromUUID(uuid)
|
||||
if err != nil {
|
||||
httpError(w, r, err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// create a new session with these credentials
|
||||
response, err := account.Login(username, r.Form.Get("password"))
|
||||
if err != nil {
|
||||
httpError(w, r, err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
writeJSON(w, r, response)
|
||||
}
|
||||
|
||||
func handleAccountLogout(w http.ResponseWriter, r *http.Request) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user