Пример #1
0
        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);
        }