Ejemplo n.º 1
0
        public async Task<ReturnSet<AuthenticationResponseItem>> AttemptLogin(AuthenticationRequestItem requestItem) {
            using (var eFactory = new EFModel()) {
                var result =
                    await eFactory.Users.AnyAsync(
                        a => a.Username == requestItem.Username && a.Password == requestItem.Password);

                if (!result) {
                    return new ReturnSet<AuthenticationResponseItem>(ErrorCodes.AUTH_FAILED_USERNAME_OR_PASSWORD);
                }

                return new ReturnSet<AuthenticationResponseItem>(new AuthenticationResponseItem());
            }
        }
Ejemplo n.º 2
0
 public async Task<ReturnSet<AuthenticationResponseItem>> GET(AuthenticationRequestItem requestItem) {
     return await new AuthenticationManager(APIWrapper).AttemptLogin(requestItem);
 }