diff options
Diffstat (limited to 'samples/OpenIdProviderMvc/Controllers/UserController.cs')
-rw-r--r-- | samples/OpenIdProviderMvc/Controllers/UserController.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/samples/OpenIdProviderMvc/Controllers/UserController.cs b/samples/OpenIdProviderMvc/Controllers/UserController.cs index 70bea04..0a5b04e 100644 --- a/samples/OpenIdProviderMvc/Controllers/UserController.cs +++ b/samples/OpenIdProviderMvc/Controllers/UserController.cs @@ -8,16 +8,18 @@ namespace OpenIdProviderMvc.Controllers { public class UserController : Controller { public ActionResult Identity(string id) { - var redirect = this.RedirectIfNotNormalizedRequestUri(); - if (redirect != null) { - return redirect; + if (!string.IsNullOrEmpty(id)) { + var redirect = this.RedirectIfNotNormalizedRequestUri(); + if (redirect != null) { + return redirect; + } } if (Request.AcceptTypes.Contains("application/xrds+xml")) { return View("Xrds"); } - this.ViewData["username"] = id; + this.ViewData["username"] = string.IsNullOrEmpty(id) ? "anonymous" : id; return View(); } |