mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-08-11 02:53:15 +08:00
Create new session on password change
This commit is contained in:
parent
446272e3ea
commit
bbf64a3c3b
@ -113,7 +113,20 @@ func handleAccountChangePW(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
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) {
|
func handleAccountLogout(w http.ResponseWriter, r *http.Request) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user