public IActionResult RemoveRefreshToken(TokenResource tokenResource)
        {
            var accessTokenResponse =
                _authenticationService.RevokeRefreshToken(tokenResource.RefreshToken);

            if (accessTokenResponse.Success)
            {
                return(Ok(accessTokenResponse.AccessToken));
            }

            return(BadRequest(accessTokenResponse.Message));
        }
        public IActionResult RemoveRefreshToken([FromBody] TokenResource tokenResource)
        {
            BaseResponse <AccessToken> accessTokenResponse = authenticationService.RevokeRefreshToken(tokenResource.RefreshToken);

            if (accessTokenResponse.Success)
            {
                return(Ok(accessTokenResponse.Extra));
            }
            else
            {
                return(BadRequest(accessTokenResponse.ErrorMessage));
            }
        }
Esempio n. 3
0
        public IActionResult RefreshToken(TokenResource tokenResource)
        {
            AccessTokenResponse accessTokenResponse = authenticationService.CreareAccessTokenWithRefreshToken(tokenResource.RefreshToken);

            if (accessTokenResponse.Success)
            {
                return(Ok(accessTokenResponse.accessToken));
            }
            else
            {
                return(BadRequest(accessTokenResponse.Message));
            }
        }