コード例 #1
0
ファイル: AuthService.cs プロジェクト: zsuzitor/menu_back
        ///---------------------------------------------------------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));

            //
        }