diff Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs @ 112:0bca45e1e664

Pantalla de Perfil donde se puede asociar la cuenta de twitter al usuario existente
author Nelo@Kenia.neluz.int
date Sat, 11 Jun 2011 01:20:59 -0300
parents 1ee5711256db
children 7a2eeb9e9bf9
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Wed Jun 08 08:40:04 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Controllers/AccountController.cs	Sat Jun 11 01:20:59 2011 -0300
@@ -73,8 +73,8 @@
 				var response = oAuth.AccessTokenGet(Request["oauth_token"], Request["oauth_verifier"]);
 				if (response.Length > 0)
 				{
-					var username = GetResponseContent(response, "screen_name");
-					var nombre = GetResponseContent(response, "name");
+					var username = OAuthTwitter.GetResponseContent(response, "screen_name");
+					var nombre = OAuthTwitter.GetResponseContent(response, "name");
 
 					var personaService = AgendaFactory.GetPersonaService();
 					if (personaService.Validate(IdentityProviderEnum.Twitter, username, nombre))
@@ -89,23 +89,6 @@
 			return RedirectToAction("LogOn");
 		}
 
-		private static string GetResponseContent(string response, string tagName)
-		{
-			var tagStart = "\"" + tagName + "\":";
-			var tagEnd = ",";
-
-			var start = response.IndexOf(tagStart) + tagStart.Length;
-			if (start > tagStart.Length)
-			{
-				var end = response.IndexOf(tagEnd, start);
-				if (end > 0)
-				{
-					return response.Substring(start + 1, end - start - 2);
-				}
-			}
-			return string.Empty;
-		}
-
     	// **************************************
         // URL: /Account/LogOff
         // **************************************