コード例 #1
0
        public IHttpActionResult checkTokenUser(string token, string user)
        {
            if (string.IsNullOrEmpty(token))
            {
                return BadRequest("Bad Request. This method doesn't exists or the necessary parameters weren't provided");
            }
            TokenValidationResult tokenresult = new TokenValidationResult();
            tokenresult.valid = ur.checkUserToken(token, user);

            return Ok(tokenresult);
        }
コード例 #2
0
 public IHttpActionResult checkToken(string token)
 {
     if (string.IsNullOrEmpty(token))
     {
         return BadRequest("Bad Request. This method doesn't exists or the necessary parameters weren't provided");
     }
     TokenValidationResult tokenresult = new TokenValidationResult();
     try
     {
         tokenresult.valid = ur.tokenIsCorrect(token);
     }
     catch (Exception)
     {
         tokenresult.valid = false;
     }
     return Ok(tokenresult);
 }