complete password reset

This commit is contained in:
GotPPay
2018-06-01 18:53:06 +02:00
parent b683e813fe
commit 2fc6619383
5 changed files with 35 additions and 9 deletions

View File

@@ -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 = ?;`