changeset 92:7027cda13de3

Armado de la url de retorno en base a la url del request
author Nelo@Kenia.neluz.int
date Fri, 03 Jun 2011 23:58:03 -0300
parents 9dfbe4e29c6a
children 65f0b3d70c18
files Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Fri Jun 03 23:57:39 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Fri Jun 03 23:58:03 2011 -0300
@@ -65,7 +65,11 @@
 			{
 				//Redirect the user to Twitter for authorization.
 				//Using oauth_callback for local testing.
-				oAuth.CallBackUrl = "http://localhost:1424/Account/TwitterLogOn";
+				var action = Url.Action("TwitterLogOn");
+				var url = Request.Url.Scheme + "://" + Request.Url.Host +
+				          (Request.Url.Port != 80 ? ":" + Request.Url.Port : string.Empty) + action;
+
+				oAuth.CallBackUrl = url;
 				Response.Redirect(oAuth.AuthorizationLinkGet());
 			}
 			else