Exemplo n.º 1
0
        public AuthenticationResult LogIn(string userName, string password, bool stayLoggedInToday = false)
        {
            UserInfo userInfo = identityService.ValidateUserCredentials(userName, password);

            userInfo.StayLoggedInToday = stayLoggedInToday;

            storage.SaveIdentity(userInfo);
            return(AuthenticationResult.Success(userInfo.MustChangePassword));
        }
Exemplo n.º 2
0
        public async Task <AuthenticationResult> LogIn(HttpContext httpContext, string userName, string password, bool stayLoggedInToday = false)
        {
            UserInfo userInfo = identityService.ValidateUserCredentials(userName, password);

            userInfo.StayLoggedInToday = stayLoggedInToday;

            await storage.SaveIdentity(httpContext, userInfo);

            return(AuthenticationResult.Success(userInfo.MustChangePassword));
        }