public async Task WhenResetPasswordCalledWithThenDoNotSetSessionRedirect()
        {
            A.CallTo(() => authClient.GetResetPasswordUrl()).Returns("test");
            var settings = Options.Create(new AuthSettings());
            var session  = new MockHttpSession();

            using var controller = new AuthController(authClient, log, settings, defaultVersionedFiles, defaultConfiguration, baseUrlService)
                  {
                      ControllerContext = new ControllerContext
                      {
                          HttpContext = new DefaultHttpContext
                          {
                              User    = new ClaimsPrincipal(new ClaimsIdentity(new List <Claim>())),
                              Session = session,
                          },
                      },
                  };

            var result = await controller.ResetPassword().ConfigureAwait(false) as RedirectResult;

            A.CallTo(() => authClient.GetResetPasswordUrl()).MustHaveHappened();
            Assert.Null(session.GetString(AuthController.RedirectSessionKey));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> ResetPassword()
        {
            var signInUrl = await authClient.GetResetPasswordUrl();

            return(Redirect(signInUrl));
        }