added forgot password
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package services
|
||||
|
||||
import "authentication/db"
|
||||
|
||||
func ForgotPassword(email string) (bool, error) {
|
||||
selectQuery := "SELECT EXISTS(SELECT 1 FROM uess_user_management.users WHERE email_address = ?)"
|
||||
var exists string
|
||||
|
||||
err := db.DB.QueryRow(selectQuery, email).Scan(&exists)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if exists == "0" {
|
||||
return false, nil
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
Reference in New Issue
Block a user