Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool LoginUserUsingOpenID(BaseDBContext db, ClaimsResponse r)
- {
- string email = r.Email;
- bool doesntExist = !UserHelper.DoesUserExist(db, r.Email);
- User u = null;
- if (doesntExist)
- {
- u.Email = email;
- u.Username = "User" + new Random().Next(100000);
- u.Password = CreateRandomPassword(7);
- u.prepareForCreationFromThirdParty();
- }
- else
- {
- u = db.Users.Where(x => x.Email == r.Email).FirstOrDefault();
- }
- SetUserAsAuthenticated(u);
- AddAutomaticLoginKeyForUser(db, u); //Need to get this to the users frontend somehow..
- return true;
- }
- System.NullReferenceException: Object reference not set to an instance of an object.
- at MusingMonkey.Helpers.SecurityHelper.LoginUserUsingOpenID(BaseDBContext db, ClaimsResponse r) in C:UsersWilliam-BusinessDesktopTWBTWB CentralProjectsMusingMonkeyMusingMonkeyHelpersSecurityHelper.cs:line 170
- at MusingMonkey.Controllers.UsersController.HandleOpenIDResponse() in C:UsersWilliam-BusinessDesktopTWBTWB CentralProjectsMusingMonkeyMusingMonkeyControllersUsersController.cs:line 78
- at lambda_method(Closure , ControllerBase , Object[] )
- at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
- at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
- at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
- at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
- at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult)
- at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
- at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
- User u = null;
- if (doesntExist)
- {
- u.Email = email;
- ...
- User u = new User();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement