Exemple #1
0
        public async Task SignsUpOkOnValidData(string nickname, string password)
        {
            var token = await authenticationService.SignUp(nickname, password);

            Assert.NotNull(token);
            Assert.NotNull(JwtTool.DecodeToken(token));
        }
Exemple #2
0
        public void UseToken(string token)
        {
            var jwt = JwtTool.DecodeToken(token);

            var userId = jwt.Claims
                         .Where(x => x.Type == ClaimsIdentity.DefaultNameClaimType)
                         .Select(x => int.Parse(x.Value))
                         .First();

            UserId = userId;
        }