Add resolver to resend verify email link

Resolves #20
This commit is contained in:
Lakhan Samani
2021-07-18 12:56:17 +05:30
parent e2fc610762
commit 2840a085ca
8 changed files with 193 additions and 11 deletions

View File

@@ -41,6 +41,18 @@ func (mgr *manager) GetVerificationByToken(token string) (VerificationRequest, e
return verification, nil
}
func (mgr *manager) GetVerificationByEmail(email string) (VerificationRequest, error) {
var verification VerificationRequest
result := mgr.db.Where("email = ?", email).First(&verification)
if result.Error != nil {
log.Println(`Error getting verification token:`, result.Error)
return verification, result.Error
}
return verification, nil
}
func (mgr *manager) DeleteToken(email string) error {
var verification VerificationRequest
result := mgr.db.Where("email = ?", email).Delete(&verification)