aboutsummaryrefslogtreecommitdiff
path: root/backend/api/api/Controllers/AuthController.cs
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-03-08 18:58:09 +0100
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-03-08 18:58:09 +0100
commit0240854fb119a1bbbf799daa11c978783331ecd4 (patch)
treec297b3d8e9288ecc594336058afa27a5d2e0611b /backend/api/api/Controllers/AuthController.cs
parent52dec403d19a732591f9ce27ec802e3f8c480a9a (diff)
Dodata autorizacija sa test zahtevom.
Diffstat (limited to 'backend/api/api/Controllers/AuthController.cs')
-rw-r--r--backend/api/api/Controllers/AuthController.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/api/api/Controllers/AuthController.cs b/backend/api/api/Controllers/AuthController.cs
index 100ab3ca..c74c579d 100644
--- a/backend/api/api/Controllers/AuthController.cs
+++ b/backend/api/api/Controllers/AuthController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using api.Services;
+using Microsoft.AspNetCore.Authorization;
namespace api.Controllers
{
@@ -29,6 +30,13 @@ namespace api.Controllers
return Ok(_auth.Login(user));
}
+ [HttpGet("Auth")]
+ [Authorize(Roles ="User")]
+ public async Task<ActionResult<string>> TestAuth()
+ {
+ return Ok("works");
+ }
+
}
}