Add password changes

This commit is contained in:
maru committed 2024-04-28 17:27:58 -04:00
1 parent 4ce5a0198d
commit cbcc68f8e4
4 files changed
+59

No files matched your search

+9
View File
@@ -32,6 +32,15 @@ func AddAccountSession(username string, token []byte) error {
return nil
}
func UpdateAccountPassword(uuid, key, salt []byte) error {
_, err := handle.Exec("UPDATE accounts SET (hash, salt) VALUES (?, ?) WHERE uuid = ?", key, salt, uuid)
if err != nil {
return err
}
return nil
}
func UpdateAccountLastActivity(uuid []byte) error {
_, err := handle.Exec("UPDATE accounts SET lastActivity = UTC_TIMESTAMP() WHERE uuid = ?", uuid)
if err != nil {