Beispiel #1
0
        public UserDto AgentFromUsername(string username)
        {
            User    user    = _userRepository.FindByUsername(username);
            UserDto userDto = ApplicationAdapter.FromUserToUserDto(user);

            return(userDto);
        }
Beispiel #2
0
        public AuthResponse Authenticate(string username, string password)
        {
            AuthResponse authResponse = null;
            User         agent        = _userRepository.FindByUsername(username);
            string       token        = _authDomainService.Authenticate(agent, password);

            if (token != null)
            {
                authResponse = new AuthResponse
                {
                    BearerToken     = token,
                    IsAuthenticated = true,
                    User            = ApplicationAdapter.FromUserToUserDto(agent)
                };
            }


            return(authResponse);
        }