complete password reset
This commit is contained in:
@@ -462,6 +462,22 @@ func (c *userRepo) UpdateLogin(user entity.User) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *userRepo) UpdateLoginPassword(user entity.User) error {
|
||||
const (
|
||||
query = `UPDATE tab_login a
|
||||
INNER JOIN tab_user b
|
||||
ON a.user_id = b.user_id
|
||||
SET a.password = sha2(?, 512)
|
||||
WHERE b.user_uuid = ?`
|
||||
)
|
||||
|
||||
if _, err := c.conn.Exec(query, user.Pass, user.UUID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *userRepo) RemoveContact(contact entity.ContactInfo) (entity.ContactInfo, error) {
|
||||
const (
|
||||
query = `DELETE FROM tab_contact WHERE contact_uuid = ?;`
|
||||
|
||||
Reference in New Issue
Block a user