Exemplo n.º 1
0
        public async ValueTask <ActionResult> CheckTokenForUsability([FromRoute] string token,
                                                                     [FromServices] IAccessTokensLogsService logsService)
        {
            if (token is null ||
                token.Length != 64)
            {
                return(BadRequest());
            }

            var checkTokenResult = await _accessUsersTokensService.CanMakeRequestAsync(token);

            if (!checkTokenResult)
            {
                return(Forbid());
            }

            await logsService.LogAsync(token);

            return(Ok());
        }
Exemplo n.º 2
0
 public AccessTokensLogsController(IAccessTokensLogsService accessTokensLogsService) =>