diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-05-06 22:29:54 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-05-06 22:29:54 +0300 |
| commit | cabbcc1ef8f3ab711371eec6a65c255e61de413a (patch) | |
| tree | 68613d777304ccd80e4e33f452dfef7b10f12206 /ExamTemplate/Web/Controllers/UserController.cs | |
| parent | 57cc5682a0efe2b790015f77fe9d2e2a0bb6ed87 (diff) | |
| download | it-kariera-exam-template-cabbcc1ef8f3ab711371eec6a65c255e61de413a.tar it-kariera-exam-template-cabbcc1ef8f3ab711371eec6a65c255e61de413a.tar.gz it-kariera-exam-template-cabbcc1ef8f3ab711371eec6a65c255e61de413a.zip | |
Impllemented user login and updated navbar
Diffstat (limited to 'ExamTemplate/Web/Controllers/UserController.cs')
| -rw-r--r-- | ExamTemplate/Web/Controllers/UserController.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ExamTemplate/Web/Controllers/UserController.cs b/ExamTemplate/Web/Controllers/UserController.cs index cd472de..f4b6edf 100644 --- a/ExamTemplate/Web/Controllers/UserController.cs +++ b/ExamTemplate/Web/Controllers/UserController.cs @@ -38,5 +38,26 @@ namespace ExamTemplate.Web.Controllers else return View(); } + + [HttpGet] + [Route("/Login")] + public IActionResult Login() + { + return View(); + } + + [HttpPost] + [Route("/Login")] + public async Task<IActionResult> Login(LoginUserViewModel loginUserViewModel) + { + LoginUserServiceModel loginUserServiceModel = this._autoMapper.Map<LoginUserServiceModel>(loginUserViewModel); + + bool result = await this._userService.LoginUserAsync(loginUserServiceModel); + + if (result) + return RedirectToAction("Index", "Home"); + else + return View(); + } } } |
