예제 #1
0
        public IActionResult Logout([FromBody] JWTModel jwt)
        {
            bool res = _authService.Logout(jwt.token);

            if (!res)
            {
                return(this.BadRequest(new { message = "Failed to logout" }));
            }

            return(Ok(res));
        }
예제 #2
0
        public IActionResult Validate([FromBody] JWTModel jwt)
        {
            bool res = _authService.Validate(jwt.token);

            if (!res)
            {
                return(this.NotFound(new { message = "Token is not valid" }));
            }

            return(Ok(true));
        }