Skip to content
Browse files

Merge pull request #317 from NuGet/noemaillogon

Fixed #315 by only allowing usernames for logons and fixed #311 too.
  • Loading branch information...
2 parents 7212fa6 + 462701a commit c71fb724b382646bcd6dde37af4b5a613e48aef6 Jeff Handley committed Dec 7, 2011
View
6 Facts/Controllers/AuthenticationControllerFacts.cs
@@ -35,7 +35,7 @@ public void WillLogTheUserOnWhenTheUsernameAndPasswordAreValidAndUserIsConfirmed
userSvc: userSvc);
controller.LogOn(
- new SignInRequest() { UserNameOrEmail = "theUsername", Password = "thePassword" },
+ new SignInRequest() { UserName = "theUsername", Password = "thePassword" },
"theReturnUrl");
formsAuthSvc.Verify(x => x.SetAuthCookie(
@@ -57,7 +57,7 @@ public void WillNotLogTheUserOnWhenTheUsernameAndPasswordAreValidAndUserIsNotCon
userSvc: userSvc);
controller.LogOn(
- new SignInRequest() { UserNameOrEmail = "theUsername", Password = "thePassword" },
+ new SignInRequest() { UserName = "theUsername", Password = "thePassword" },
"theReturnUrl");
}
@@ -77,7 +77,7 @@ public void WillLogTheUserOnWithRolesWhenTheUsernameAndPasswordAreValidAndUserIs
userSvc: userSvc);
controller.LogOn(
- new SignInRequest() { UserNameOrEmail = "theUsername", Password = "thePassword" },
+ new SignInRequest() { UserName = "theUsername", Password = "thePassword" },
"theReturnUrl");
formsAuthSvc.Verify(x => x.SetAuthCookie(
View
3 Website/Controllers/AuthenticationController.cs
@@ -33,9 +33,8 @@ public virtual ActionResult LogOn(SignInRequest request, string returnUrl)
if (!ModelState.IsValid)
return View();
- // TODO: allow users to sign in with email address in addition to user name
var user = userSvc.FindByUsernameAndPassword(
- request.UserNameOrEmail,
+ request.UserName,
request.Password);
if (user == null)
View
4 Website/RequestModels/SignInRequest.cs
@@ -6,8 +6,8 @@ public class SignInRequest
{
[Required]
[Display(Name = "Username")]
- [Hint("Enter either your username or email address.")]
- public string UserNameOrEmail { get; set; }
+ [Hint("Enter your username.")]
+ public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
View
34 Website/Views/Authentication/LogOn.generated.cs
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
+// Runtime Version:4.0.30319.488
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -45,7 +45,7 @@ public override void Execute()
{
-WriteLiteral("\n<h1>Log On</h1>\n\n<p>\n Don\'t have an account yet? <a href=\"");
+WriteLiteral("\r\n<h1>Log On</h1>\r\n\r\n<p>\r\n Don\'t have an account yet? <a href=\"");
@@ -55,7 +55,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\">Register now.</a>\n</p>\n\n");
+WriteLiteral("\">Register now.</a>\r\n</p>\r\n\r\n");
@@ -65,7 +65,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral(" <fieldset class=\"form\">\n <legend>Log On Form</legend>\n\n ");
+WriteLiteral(" <fieldset class=\"form\">\r\n <legend>Log On Form</legend>\r\n\r\n ");
@@ -75,7 +75,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n ");
+WriteLiteral("\r\n ");
@@ -85,7 +85,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n\n");
+WriteLiteral("\r\n\r\n");
@@ -104,7 +104,7 @@ public override void Execute()
-WriteLiteral(" <p class=\"validation-summary-errors\">\n ");
+WriteLiteral(" <p class=\"validation-summary-errors\">\r\n ");
@@ -114,7 +114,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n </p>\n");
+WriteLiteral("\r\n </p>\r\n");
@@ -124,7 +124,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n ");
+WriteLiteral("\r\n ");
@@ -134,7 +134,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n\n <img src=\"");
+WriteLiteral("\r\n\r\n <img src=\"");
@@ -144,8 +144,8 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\" alt=\"Blue border on left means required.\" />\n\n <input type=\"submit\" valu" +
-"e=\"Log On\" title=\"Log On\" />\n ");
+WriteLiteral("\" alt=\"Blue border on left means required.\" />\r\n\r\n <input type=\"submit\" va" +
+"lue=\"Log On\" title=\"Log On\" />\r\n ");
@@ -155,7 +155,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n </fieldset>\n");
+WriteLiteral("\r\n </fieldset>\r\n");
@@ -165,12 +165,12 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n");
+WriteLiteral("\r\n");
DefineSection("BottomScripts", () => {
-WriteLiteral("\n <script src=\"");
+WriteLiteral("\r\n <script src=\"");
@@ -180,7 +180,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\"></script>\n <script src=\"");
+WriteLiteral("\"></script>\r\n <script src=\"");
@@ -190,7 +190,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\"></script>\n");
+WriteLiteral("\"></script>\r\n");
});
View
1 Website/Views/Shared/Layout.cshtml
@@ -9,6 +9,7 @@
<link href="@Url.Content("~/favicon.ico")" rel="shortcut icon" type="image/x-icon" />
<script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")"></script>
@MvcMiniProfiler.MiniProfiler.RenderIncludes()
+ @Analytics.GetGoogleHtml("UA-177588-7")
</head>
<body>
<div id="content-wraper">
View
172 Website/Views/Shared/Layout.generated.cs
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
+// Runtime Version:4.0.30319.488
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -44,9 +44,9 @@ public Layout()
public override void Execute()
{
-WriteLiteral("<!DOCTYPE html> \n<html lang=\"en\" class=\"static \"> \n <head>\n <meta chars" +
-"et=\"utf-8\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n " +
-" <title>NuGet Gallery</title> \n <link href=\"");
+WriteLiteral("<!DOCTYPE html> \r\n<html lang=\"en\" class=\"static \"> \r\n <head>\r\n <meta ch" +
+"arset=\"utf-8\" />\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" /" +
+">\r\n <title>NuGet Gallery</title> \r\n <link href=\"");
@@ -56,7 +56,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\" rel=\"stylesheet\" />\n <link href=\"");
+WriteLiteral("\" rel=\"stylesheet\" />\r\n <link href=\"");
@@ -66,7 +66,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\" rel=\"shortcut icon\" type=\"image/x-icon\" />\n <script src=\"");
+WriteLiteral("\" rel=\"shortcut icon\" type=\"image/x-icon\" />\r\n <script src=\"");
@@ -76,7 +76,7 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\"></script>\n ");
+WriteLiteral("\"></script>\r\n ");
@@ -86,38 +86,48 @@ public override void Execute()
#line default
#line hidden
-WriteLiteral("\n </head>\n <body>\n <div id=\"content-wraper\">\n <header cla" +
-"ss=\"main\">\n <div id=\"logo\"><a href=\"");
+WriteLiteral("\r\n ");
- #line 16 "..\..\Views\Shared\Layout.cshtml"
- Write(Url.Home());
+ #line 12 "..\..\Views\Shared\Layout.cshtml"
+ Write(Analytics.GetGoogleHtml("UA-177588-7"));
#line default
#line hidden
-WriteLiteral("\">NuGet Gallery</a></div>\n ");
+WriteLiteral("\r\n </head>\r\n <body>\r\n <div id=\"content-wraper\">\r\n <header" +
+" class=\"main\">\r\n <div id=\"logo\"><a href=\"");
#line 17 "..\..\Views\Shared\Layout.cshtml"
+ Write(Url.Home());
+
+
+ #line default
+ #line hidden
+WriteLiteral("\">NuGet Gallery</a></div>\r\n ");
+
+
+
+ #line 18 "..\..\Views\Shared\Layout.cshtml"
Write(Html.Partial(MVC.Shared.Views.UserDisplay));
#line default
#line hidden
-WriteLiteral("\n </header>\n <nav class=\"main\">\n <ul id=\"men" +
-"u\">\n");
+WriteLiteral("\r\n </header>\r\n <nav class=\"main\">\r\n <ul id=\"" +
+"menu\">\r\n");
- #line 21 "..\..\Views\Shared\Layout.cshtml"
-
- var homeClass = ViewBag.Tab == "Home" ? "current" : "";
- var packagesClass = ViewBag.Tab == "Packages" ? "current" : "";
- var uploadClass = ViewBag.Tab == "Upload" ? "current" : "";
-
+ #line 22 "..\..\Views\Shared\Layout.cshtml"
+
+ var homeClass = ViewBag.Tab == "Home" ? "current" : "";
+ var packagesClass = ViewBag.Tab == "Packages" ? "current" : "";
+ var uploadClass = ViewBag.Tab == "Upload" ? "current" : "";
+
#line default
@@ -126,7 +136,7 @@ public override void Execute()
- #line 26 "..\..\Views\Shared\Layout.cshtml"
+ #line 27 "..\..\Views\Shared\Layout.cshtml"
Write(homeClass);
@@ -136,17 +146,17 @@ public override void Execute()
- #line 26 "..\..\Views\Shared\Layout.cshtml"
+ #line 27 "..\..\Views\Shared\Layout.cshtml"
Write(Url.Home());
#line default
#line hidden
-WriteLiteral("\">Home</a></li>\n <li class=\"");
+WriteLiteral("\">Home</a></li>\r\n <li class=\"");
- #line 27 "..\..\Views\Shared\Layout.cshtml"
+ #line 28 "..\..\Views\Shared\Layout.cshtml"
Write(packagesClass);
@@ -156,17 +166,17 @@ public override void Execute()
- #line 27 "..\..\Views\Shared\Layout.cshtml"
+ #line 28 "..\..\Views\Shared\Layout.cshtml"
Write(Url.PackageList());
#line default
#line hidden
-WriteLiteral("\">Packages</a></li>\n <li class=\"");
+WriteLiteral("\">Packages</a></li>\r\n <li class=\"");
- #line 28 "..\..\Views\Shared\Layout.cshtml"
+ #line 29 "..\..\Views\Shared\Layout.cshtml"
Write(uploadClass);
@@ -176,53 +186,53 @@ public override void Execute()
- #line 28 "..\..\Views\Shared\Layout.cshtml"
+ #line 29 "..\..\Views\Shared\Layout.cshtml"
Write(Url.UploadPackage());
#line default
#line hidden
-WriteLiteral("\" class=\"upload\">Upload Package</a></li>\n <li><a href=\"http://" +
-"docs.nuget.org\">Documentation</a></li>\n </ul>\n <di" +
-"v id=\"searchBox\">\n <form action=\"");
+WriteLiteral("\" class=\"upload\">Upload Package</a></li>\r\n <li><a href=\"http:/" +
+"/docs.nuget.org\">Documentation</a></li>\r\n </ul>\r\n " +
+"<div id=\"searchBox\">\r\n <form action=\"");
- #line 32 "..\..\Views\Shared\Layout.cshtml"
+ #line 33 "..\..\Views\Shared\Layout.cshtml"
Write(Url.PackageList());
#line default
#line hidden
-WriteLiteral("\" method=\"get\">\n <input name=\"q\" id=\"searchBoxInput\" place" +
-"holder=\"Search Packages\" value=\"");
+WriteLiteral("\" method=\"get\">\r\n <input name=\"q\" id=\"searchBoxInput\" plac" +
+"eholder=\"Search Packages\" value=\"");
- #line 33 "..\..\Views\Shared\Layout.cshtml"
+ #line 34 "..\..\Views\Shared\Layout.cshtml"
Write(String.IsNullOrEmpty(ViewBag.SearchTerm) ? "" : ViewBag.SearchTerm);
#line default
#line hidden
-WriteLiteral("\" />\n <input id=\"searchBoxSubmit\" type=\"submit\" value=\" \" " +
-"/>\n <input type=\"hidden\" name=\"sortOrder\" value=\"");
+WriteLiteral("\" />\r\n <input id=\"searchBoxSubmit\" type=\"submit\" value=\" \"" +
+" />\r\n <input type=\"hidden\" name=\"sortOrder\" value=\"");
- #line 35 "..\..\Views\Shared\Layout.cshtml"
+ #line 36 "..\..\Views\Shared\Layout.cshtml"
Write(Const.DefaultPackageListSortOrder);
#line default
#line hidden
-WriteLiteral("\" />\n </form>\n </div>\n </nav>\n " +
-" <div id=\"body\">\n");
+WriteLiteral("\" />\r\n </form>\r\n </div>\r\n </nav>\r\n " +
+" <div id=\"body\">\r\n");
- #line 40 "..\..\Views\Shared\Layout.cshtml"
- if (TempData.ContainsKey("Message")) {
+ #line 41 "..\..\Views\Shared\Layout.cshtml"
+ if (TempData.ContainsKey("Message")) {
#line default
@@ -231,18 +241,18 @@ public override void Execute()
- #line 41 "..\..\Views\Shared\Layout.cshtml"
+ #line 42 "..\..\Views\Shared\Layout.cshtml"
Write(TempData["Message"]);
#line default
#line hidden
-WriteLiteral("</p>\n");
+WriteLiteral("</p>\r\n");
- #line 42 "..\..\Views\Shared\Layout.cshtml"
- }
+ #line 43 "..\..\Views\Shared\Layout.cshtml"
+ }
#line default
@@ -251,79 +261,79 @@ public override void Execute()
- #line 43 "..\..\Views\Shared\Layout.cshtml"
+ #line 44 "..\..\Views\Shared\Layout.cshtml"
Write(RenderBody());
#line default
#line hidden
-WriteLiteral(@"
- </div>
- </div>
- <div id=""layout-footer"" class=""group"">
- <footer id=""footer"">
- <ul class=""recommended"">
- <li>
- <a href=""http://docs.nuget.org/docs/start-here/overview"">Overview</a>
- <p>NuGet is a Visual Studio 2010 extension that makes it easy to add, remove, and update libraries and...</p>
- </li>
- <li>
- <a href=""http://docs.nuget.org/docs/start-here/installing-nuget"">Install</a>
- <p>NuGet can be installed and updated using the Visual Studio Extension Manager. To check if your copy...</p>
- </li>
- <li>
- <a href=""http://docs.nuget.org/docs/start-here/videos"">Videos</a>
- <p>Watch screencasts and presentations about anything and everything NuGet.</p>
- </li>
- <li>
- <a href=""http://docs.nuget.org/docs/start-here/nuget-faq"">FAQ</a>
- <p>Read the Frequently Asked Questions about NuGet and see if your question made the list.</p>
- </li>
- </ul>
- <div class=""license"">
- <p>
+WriteLiteral(@"
+ </div>
+ </div>
+ <div id=""layout-footer"" class=""group"">
+ <footer id=""footer"">
+ <ul class=""recommended"">
+ <li>
+ <a href=""http://docs.nuget.org/docs/start-here/overview"">Overview</a>
+ <p>NuGet is a Visual Studio 2010 extension that makes it easy to add, remove, and update libraries and...</p>
+ </li>
+ <li>
+ <a href=""http://docs.nuget.org/docs/start-here/installing-nuget"">Install</a>
+ <p>NuGet can be installed and updated using the Visual Studio Extension Manager. To check if your copy...</p>
+ </li>
+ <li>
+ <a href=""http://docs.nuget.org/docs/start-here/videos"">Videos</a>
+ <p>Watch screencasts and presentations about anything and everything NuGet.</p>
+ </li>
+ <li>
+ <a href=""http://docs.nuget.org/docs/start-here/nuget-faq"">FAQ</a>
+ <p>Read the Frequently Asked Questions about NuGet and see if your question made the list.</p>
+ </li>
+ </ul>
+ <div class=""license"">
+ <p>
&copy; ");
- #line 68 "..\..\Views\Shared\Layout.cshtml"
+ #line 69 "..\..\Views\Shared\Layout.cshtml"
Write(DateTime.UtcNow.Year);
#line default
#line hidden
-WriteLiteral(" Outercurve Foundation.\n </p>\n ");
+WriteLiteral(" Outercurve Foundation.\r\n </p>\r\n ");
- #line 70 "..\..\Views\Shared\Layout.cshtml"
+ #line 71 "..\..\Views\Shared\Layout.cshtml"
Write(ViewHelpers.ReleaseTag());
#line default
#line hidden
-WriteLiteral("\n </div>\n </footer>\n </div>\n <script src=" +
-"\"");
+WriteLiteral("\r\n </div>\r\n </footer>\r\n </div>\r\n <script " +
+"src=\"");
- #line 74 "..\..\Views\Shared\Layout.cshtml"
+ #line 75 "..\..\Views\Shared\Layout.cshtml"
Write(Url.Content("~/Scripts/jquery-1.6.2.min.js"));
#line default
#line hidden
-WriteLiteral("\"></script>\n ");
+WriteLiteral("\"></script>\r\n ");
- #line 75 "..\..\Views\Shared\Layout.cshtml"
+ #line 76 "..\..\Views\Shared\Layout.cshtml"
Write(RenderSection("BottomScripts", required: false));
#line default
#line hidden
-WriteLiteral("\n </body>\n</html>");
+WriteLiteral("\r\n </body>\r\n</html>");
}

0 comments on commit c71fb72

Please sign in to comment.
Something went wrong with that request. Please try again.