# HG changeset patch
# User nelopauselli
# Date 1314193093 10800
# Node ID beeb06da43988ac4352f392d967d6114328304a1
# Parent cfefc8a2ebc21e5446630dd5479f359a25557598
Al querés ingresar a un lugar que requiere autenticación y luego de autenticarse, vuelve a la página donde quería entrar
diff -r cfefc8a2ebc2 -r beeb06da4398 Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs
--- a/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs Wed Aug 24 10:19:48 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs Wed Aug 24 10:38:13 2011 -0300
@@ -23,15 +23,18 @@
return View();
}
- public ActionResult TwitterLogOn()
+ public ActionResult TwitterLogOn(string returnUrl)
{
var oAuth = new OAuthTwitter();
if (Request["oauth_token"] == null)
{
var action = Url.Action("TwitterLogOn");
+ if (!string.IsNullOrWhiteSpace(returnUrl))
+ action += "?ReturnUrl=" + returnUrl;
+
var url = Request.Url.Scheme + "://" + Request.Url.Host +
- (Request.Url.Port != 80 ? ":" + Request.Url.Port : string.Empty) + action;
+ (Request.Url.Port != 80 ? ":" + Request.Url.Port : string.Empty) + action;
return Redirect(oAuth.AuthorizationLinkGet(url).ToString());
}
@@ -58,6 +61,9 @@
personaService.CreateIfNotExist(IdentityProviderEnum.Twitter, username, nombre);
_formsService.SignIn(Identification.Map[(int)IdentityProviderEnum.Twitter]+username, false);
+
+ if (!string.IsNullOrWhiteSpace(returnUrl))
+ return Redirect(returnUrl);
return RedirectToAction("Index", "Home");
}
diff -r cfefc8a2ebc2 -r beeb06da4398 Agendas/trunk/src/Agendas.Web/Views/Account/LogOn.cshtml
--- a/Agendas/trunk/src/Agendas.Web/Views/Account/LogOn.cshtml Wed Aug 24 10:19:48 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Views/Account/LogOn.cshtml Wed Aug 24 10:38:13 2011 -0300
@@ -12,7 +12,7 @@
+ | Identifíquese utilizando su cuenta de twitter |