Create new session on password change

This commit is contained in:
Pancakes 2025-07-07 21:03:31 -04:00
parent f5b0cdb32b
commit 3f648b55e6
No known key found for this signature in database
GPG Key ID: 5792877BFA27DC8F

View File

@ -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) {