Maverick.Web.Controllers.IdentityController.Land C# (CSharp) Method

Land() private method

private Land ( string id ) : System.Web.Mvc.ActionResult
id string
return System.Web.Mvc.ActionResult
        public ActionResult Land(string id)
        {
            // "id" is the name of the identity source
            // TODO: Refactor this into a Model Binder to reduce duplication
            IdentitySource identitySource = GetIdentitySource(id);
            if(identitySource == null) {
                return ResourceNotFound();
            }

            identitySource.OnReturnFromProvider(ControllerContext);

            Uri returnUrl = identitySource.GetReturnUrl(ControllerContext);
            if (returnUrl == null) {
                return new RedirectToRouteResult(new RouteValueDictionary(new {
                    page = (Page)null,
                    controller = DefaultControllerName,
                    action = DefaultActionName
                }));
            }
            return new RedirectResult(returnUrl.ToString());
        }

Usage Example

Esempio n. 1
0
        public void Land_Calls_GetReturnUrl_With_ControllerContext_If_IdentitySource_Found()
        {
            // Arrange
            var controller = new IdentityController();
            controller.IdentitySources.AddMock(UnusedMockIdentitySource);

            var mockSource = controller.IdentitySources.AddMock(SelectedMockIdentitySource);

            // Act
            controller.Land(SelectedMockIdentitySource);

            // Assert
            mockSource.Verify(s => s.GetReturnUrl(controller.ControllerContext));
        }
All Usage Examples Of Maverick.Web.Controllers.IdentityController::Land