diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-07 19:16:23 +0100 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-07 19:16:23 +0100 |
commit | 5e13228f88cc0be48b12809c73b97eff50ce8bf1 (patch) | |
tree | d7bc74fb4ae85256e36352ed9b62e3e7ab58c0e8 /backend/api/api/Controllers/AuthController.cs | |
parent | 9eb7f0dd8c22782fed9ccf96fbfec3cedff2b892 (diff) | |
parent | b2e87a1085eee4bb60eb1db9abb29dd83118ac5a (diff) |
Merge branch 'backend' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'backend/api/api/Controllers/AuthController.cs')
-rw-r--r-- | backend/api/api/Controllers/AuthController.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/backend/api/api/Controllers/AuthController.cs b/backend/api/api/Controllers/AuthController.cs new file mode 100644 index 00000000..1f47067f --- /dev/null +++ b/backend/api/api/Controllers/AuthController.cs @@ -0,0 +1,34 @@ +using api.Models.Users; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using api.Services; + +namespace api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class AuthController : ControllerBase + { + private AuthService _auth; + public AuthController(IConfiguration configuration) + { + _auth=new AuthService(configuration); + } + + [HttpPost("register")] + public async Task<ActionResult<string>> Register(RegisterRequest user) + { + + return Ok(_auth.Register(user)); + } + + [HttpPost("login")] + public async Task<ActionResult<string>> Login(AuthRequest user) + { + + return Ok(_auth.Login(user)); + } + + + } +} |