Prevent initial out of date message on register

pull/4/head
Flashfyre 6 months ago
parent 512a24e5c3
commit e19104c86a

@ -41,6 +41,11 @@ func AddAccountSession(username string, token []byte) error {
return err return err
} }
_, err = handle.Exec("UPDATE sessions s JOIN accounts a ON a.uuid = s.uuid SET s.active = 1 WHERE a.username = ? AND a.lastLoggedIn IS NULL", username)
if err != nil {
return err
}
_, err = handle.Exec("UPDATE accounts SET lastLoggedIn = UTC_TIMESTAMP() WHERE username = ?", username) _, err = handle.Exec("UPDATE accounts SET lastLoggedIn = UTC_TIMESTAMP() WHERE username = ?", username)
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save