U4-3123 - Umbraco 7 - unable to use email address as user name

Created by Charles Zipp 13 Oct 2013, 17:37:46 Updated by Shannon Deminick 22 Oct 2013, 22:24:58

Description When I use an email address as the user name, i get this server error when attempting to log in. I was able to use email address as user name in previous versions of umbraco.

Steps to Reproduce

  1. Create a user and set the user name to an email address (i.e. somebody@gmail.com)
  2. Log out of the backoffice.
  3. Attempt to log back into the back office using the newly created user.

If you have chrome dev tools, you will get a HTTP status code 500 on PostLogin. Below is the stack trace.

Configuration DB - SQL CE Host - Running in debug in VS2012 Browser - Chrome

Justification If this issue is not resolved, all of our users' user names would have to be reset to something without special characters. We would likely opt to not move forward until this is resolved as it adds cost to our migration. In addition, this is a loss of functionality from earlier versions.

Error Message & Stack Login failed for user somebody@gmail.com Parameter '@gmail' specified but none of the passed arguments have a property with this name (in 'WHERE ([umbracoUser].[userLogin] = 'somebody@gmail.com')')

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Parameter '@gmail' specified but none of the passed arguments have a property with this name (in 'WHERE ([umbracoUser].[userLogin] = 'somebody@gmail.com')')

Stack Trace:

at Umbraco.Core.Persistence.Database.<>c__DisplayClass1.b__0(Match m) at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat) at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator) at Umbraco.Core.Persistence.Database.ProcessParams(String _sql, Object[] args_src, List1 args_dest) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build(StringBuilder sb, List1 args, Sql lhs) at Umbraco.Core.Persistence.Sql.Build() at Umbraco.Core.Persistence.Sql.get_SQL() at Umbraco.Core.Persistence.Database.Fetch[T1,T2,TRet](Func3 cb, Sql sql) at Umbraco.Core.Persistence.Repositories.UserRepository.d__9.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at Umbraco.Core.Services.UserService.GetUserByUserName(String username) at Umbraco.Web.Editors.AuthenticationController.PostLogin(String username, String password) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func1 func, CancellationToken cancellationToken)

Comments

Shannon Deminick 21 Oct 2013, 03:44:56

Yup we'll need to escape the '@' symbols for petapoco for these queries.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version: 7.0.0

Sprint:

Story Points:

Cycle: