diff --git a/components/core/spi_manager.go b/components/core/spi_manager.go index 6db9ff6..0489e15 100644 --- a/components/core/spi_manager.go +++ b/components/core/spi_manager.go @@ -1,6 +1,8 @@ package core import ( + "strings" + "github.com/reiver/greatape/app/commands" "github.com/reiver/greatape/app/validators" . "github.com/reiver/greatape/components/constants" @@ -360,6 +362,9 @@ func (manager *spiManager) Signup(username string, email string, password string } }() + username = strings.ToLower(username) + email = strings.ToLower(email) + editor.Lock(SIGNUP_REQUEST) defer editor.Unlock(SIGNUP_REQUEST) @@ -400,6 +405,8 @@ func (manager *spiManager) ResendVerificationCode(email string, editor Identity) } }() + email = strings.ToLower(email) + editor.Lock(RESEND_VERIFICATION_CODE_REQUEST) defer editor.Unlock(RESEND_VERIFICATION_CODE_REQUEST) @@ -440,6 +447,8 @@ func (manager *spiManager) Verify(email string, token string, code string, edito } }() + email = strings.ToLower(email) + editor.Lock(VERIFY_REQUEST) defer editor.Unlock(VERIFY_REQUEST) @@ -490,6 +499,8 @@ func (manager *spiManager) Login(email string, password string, editor Identity) } }() + email = strings.ToLower(email) + editor.Lock(LOGIN_REQUEST) defer editor.Unlock(LOGIN_REQUEST) @@ -682,6 +693,8 @@ func (manager *spiManager) ResetPassword(usernameOrEmail string, editor Identity } }() + usernameOrEmail = strings.ToLower(usernameOrEmail) + editor.Lock(RESET_PASSWORD_REQUEST) defer editor.Unlock(RESET_PASSWORD_REQUEST)