Files
2026-01-21 11:12:46 +08:00

18 lines
374 B
Go

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
}