Force user email to lower case. Include action on all forms.
This commit is contained in:
parent
1ccb0cad1a
commit
eafde27809
14 changed files with 100 additions and 50 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package routes
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"goweb/context"
|
||||
"goweb/controller"
|
||||
|
|
@ -65,7 +66,7 @@ func (c *Login) 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue