Force user email to lower case. Include action on all forms.

This commit is contained in:
mikestefanello 2021-12-25 21:30:22 -05:00
parent 1ccb0cad1a
commit eafde27809
14 changed files with 100 additions and 50 deletions

View file

@ -2,6 +2,7 @@ package routes
import (
"fmt"
"strings"
"goweb/context"
"goweb/controller"
@ -63,7 +64,7 @@ func (c *ForgotPassword) Post(ctx echo.Context) error {
// Attempt to load the user
u, err := c.Container.ORM.User.
Query().
Where(user.Email(form.Email)).
Where(user.Email(strings.ToLower(form.Email))).
Only(ctx.Request().Context())
switch err.(type) {