コード例 #1
0
        public LoginResponse Post(LoginRequest request)
        {
            string tokenSession;

            var u = AuthenticateServices.Login(request.Email, request.Password, out tokenSession);

            if (u == null)
            {
                return(new LoginResponse()
                {
                    Message = "Invalid email or password",
                    StatusCode = System.Net.HttpStatusCode.Unauthorized
                });
            }

            return(new LoginResponse()
            {
                ExpiredInMinutes = AuthenticateServices.EpireAfterMinutes,
                Message = "Success",
                StatusCode = System.Net.HttpStatusCode.OK,
                Success = true,
                TokenSession = tokenSession
            });
        }
コード例 #2
0
 public bool Valid(string tokenSession)
 {
     return(AuthenticateServices.IsValidToken(tokenSession));
 }