Fix: Email and username trimming and invitation validation (#58442)
* fix: email and username trimming and invitation validation * Trim leading and trailing whitespaces from email and username on signup * Check whether the provided email address is the same as where the invitation sent * Align tests Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
This commit is contained in:
@@ -23,6 +23,7 @@ func (l *LoginServiceFake) SetTeamSyncFunc(login.TeamSyncFunc) {}
|
||||
|
||||
type AuthInfoServiceFake struct {
|
||||
LatestUserID int64
|
||||
ExpectedUserAuth *models.UserAuth
|
||||
ExpectedUser *user.User
|
||||
ExpectedExternalUser *models.ExternalUserInfo
|
||||
ExpectedError error
|
||||
@@ -39,6 +40,7 @@ func (a *AuthInfoServiceFake) LookupAndUpdate(ctx context.Context, query *models
|
||||
|
||||
func (a *AuthInfoServiceFake) GetAuthInfo(ctx context.Context, query *models.GetAuthInfoQuery) error {
|
||||
a.LatestUserID = query.UserId
|
||||
query.Result = a.ExpectedUserAuth
|
||||
return a.ExpectedError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user