Ejemplo n.º 1
0
        public ActionResult Login()
        {
            SignedUser signedUser = null;

            if (Request["signed_request"] != null)
            {
                var signedRequest = Request["signed_request"];
                var facebookValidation = new ValidateRegistration();
                var settings = (FacebookSettings)ConfigurationManager.GetSection("facebookSettings");
                signedUser = facebookValidation.TryValidate(settings, signedRequest);
            }

            if (signedUser != null)
            {
                var user = new WeSolverUser { FacebookUid = signedUser.UserId, Email = signedUser.Email };
                var ds = new WeSolverDataSource();
                ds.AddUser(user);
                System.Diagnostics.Trace.TraceInformation("Added user {0}-{1} in table storage for user '{2}'", user.PartitionKey, user.RowKey, user.FacebookUid);
            }

            return RedirectToAction("index", "home");
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     //local storage emulator needs to be running for these integration tests to work
     CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) => configSetter("UseDevelopmentStorage=true"));
     _dataSource = new WeSolverDataSource();
 }
Ejemplo n.º 3
0
 public void CleanUp()
 {
     var ds = new WeSolverDataSource();
     ds.DeleteUser("191921");
     ds.DeleteUser("8178172");
 }