fix(components): 🐛 resolve case sensitivity issue

master
Xeronith 2023-07-20 19:11:51 +03:30
rodzic c9addad9ad
commit 51959fb83e
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -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)