public async Task <ActionResult> Authorize(string code, string scope) { User user = _sessionHelper.Get("CurrentUser") as User; await _twitchIntegration.AuthorizeTwitch(user.ID, code); return(RedirectToAction("EditIntegrations", "Account")); }
public ActionResult Rate(string userName) { var loggedInUser = _sessionHelper.Get("CurrentUser") as User; if (loggedInUser == null) { return(RedirectToAction("Login", "Login")); } var userToRate = _userManager.GetByUserName(userName); if (userToRate == null) { return(HttpNotFound()); } UserRatingViewModel viewModel = new UserRatingViewModel { Ratings = _ratingManager.GetAll(), UserRating = new UserRating { UserBeingRatedID = userToRate.ID, UserBeingRated = userToRate, RaterUserID = loggedInUser.ID } }; return(View(nameof(Rate), viewModel)); }
public ActionResult EditIntegrations() { User user = (User)_sessionHelper.Get("CurrentUser") as User; if (user == null) { return(RedirectToAction("Login", "Login")); } user = _userManger.GetById(user.ID); return(View(nameof(EditIntegrations), user.UserIntegrations)); }
public async Task <ActionResult> AuthorizeYoutube(string code) { var user = _sessionHelper.Get("CurrentUser") as User; if (user == null) { return(RedirectToAction("Login", "Login")); } await _youtubeIntegration.Authorize(user.ID, code); return(RedirectToAction("EditIntegrations", "Account")); }
public ActionResult AuthorizeTwitter() { var currentUser = _sessionHelper.Get("CurrentUser") as T5.Brothership.Entities.Models.User; if (currentUser == null) { RedirectToAction("Login", "Login"); } var appCreds = _twitterIntegration.GetCustomerCredentials(); #if DEBUG var redirectURL = "http://localhost:60920/Twitter/ValidateTwitterAuth"; #else var redirectURL = "http://" + Request.Url.Authority + "/Twitter/ValidateTwitterAuth"; #endif _authenticationContext = AuthFlow.InitAuthentication(appCreds, redirectURL); return(new RedirectResult(_authenticationContext.AuthorizationURL)); }
public IActionResult Index() { var publicRegisterSearchCriteria = SessionHelper.Get <PublicRegisterSearchCriteria>("publicRegisterSearchCriteria"); var submitButtonType = SessionHelper.GetString("publicRegisterSearchCriteria_submitButtonType"); if (publicRegisterSearchCriteria != null && submitButtonType != null) { var publicRegisterLicenceListViewModel = publicRegisterViewModelBuilder.BuildEmptySearch(); publicRegisterLicenceListViewModel.PublicRegisterSearchCriteria = publicRegisterSearchCriteria; publicRegisterLicenceListViewModel = HandlePostActions(publicRegisterLicenceListViewModel, submitButtonType); return(View(publicRegisterLicenceListViewModel)); } else { var licences = publicRegisterViewModelBuilder.BuildEmptySearch(); return(View(licences)); } }
public ActionResult Login() { return(_sessionHelper.Get("CurrentUser") == null ? (ActionResult)View(nameof(Login)) : RedirectToAction("Index", "Home")); }