handle complete
This commit is contained in:
@@ -112,8 +112,8 @@ func (c *passwordResetRepo) GetByToken(token string) (entity.PasswordReset, erro
|
||||
func (c *passwordResetRepo) SetTokenOpened(token string) error {
|
||||
const (
|
||||
query = `UPDATE tab_password_reset a
|
||||
SET a.opened = 1,
|
||||
WHERE a.token = ? AND a.used = 0 AND a.expire_date < CURRENT_TIMESTAMP`
|
||||
SET a.opened = 1
|
||||
WHERE a.token = ? AND a.used = 0 AND a.expire_date > CURRENT_TIMESTAMP`
|
||||
)
|
||||
|
||||
result, err := c.conn.Exec(query, token)
|
||||
@@ -132,7 +132,7 @@ func (c *passwordResetRepo) SetTokenUsed(token string) error {
|
||||
const (
|
||||
query = `UPDATE tab_password_reset a
|
||||
SET a.opened = 1,
|
||||
a.used = 1,
|
||||
a.used = 1
|
||||
WHERE a.token = ? AND a.used = 0`
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user