public async Task <bool> CheckToken(string accessToken) { accessToken = accessToken.Split('$')[0]; var userName = TokenModel.GetUserNameByToken(accessToken); var content = await _database.HashGetAsync(GetHashId() + userName, userName); var token = JsonConvert.DeserializeObject <TokenModel>(content); return(token?.Check(accessToken) ?? false); }