Пример #1
0
        public IDataResult <AccessToken> CreateAccessToken(Entities.Concrete.User user)
        {
            var claims      = _userService.GetClaims(user);
            var accessToken = _tokenHelper.CreateToken(user, claims.Data);

            return(new SuccessDataResult <AccessToken>(accessToken, "Token üretildi"));
        }
Пример #2
0
        public async Task <IDataResult <Entities.Concrete.User> > RegisterAsync(UserForRegisterDto userForRegisterDto)
        {
            byte[] passwordHash, PasswordSalt;
            HashingHelper.CreatePasswordHash(userForRegisterDto.Password, out passwordHash, out PasswordSalt);
            var user = new Entities.Concrete.User
            {
                Mail         = userForRegisterDto.Email,
                PasswordHash = passwordHash,
                PasswordSalt = PasswordSalt,
                Status       = true,
                TelNo        = userForRegisterDto.PhoneNumber,
                Username     = userForRegisterDto.Username,
                CoinBankId   = 1,
                ProfileId    = 1
            };
            await _userService.AddAsync(user);

            return(new SuccessDataResult <Entities.Concrete.User>(user, "Kayıt başarılı"));
        }
Пример #3
0
        public IDataResult <List <OperationClaim> > GetClaims(Entities.Concrete.User user)
        {
            var data = _userDal.GetClaims(user);

            return(new SuccessDataResult <List <OperationClaim> >(data));
        }
Пример #4
0
        public async Task <IResult> AddAsync(Entities.Concrete.User user)
        {
            await _userDal.AddAsync(user);

            return(new SuccessResult());
        }