예제 #1
0
        ///---------------------------------------------------------IAuthService-------------
        ///
        #region IAuthService



        public async Task <AllTokens> Login(LoginModel loginModel)
        {
            var user = await _userService.GetByEmailAndPasswordAsync(loginModel.Email, loginModel.Password);

            if (user == null)
            {
                throw new SomeCustomException(ErrorConsts.NotFound);
            }
            return(await _jwtService.CreateAndSetNewTokensAsync(user));

            //
        }