aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api/Api/Controllers/AuthController.cs
diff options
context:
space:
mode:
authorJelena Petrovic <jelenapetrovic.7119@gmail.com>2022-12-09 01:49:05 +0100
committerJelena Petrovic <jelenapetrovic.7119@gmail.com>2022-12-09 01:49:05 +0100
commit156b36fe78bbf017f8d435cbe774a955c4e89b0d (patch)
tree41856ec3debdf678fc63af8789bc4fd66ac7382c /Backend/Api/Api/Controllers/AuthController.cs
parentd149eb04958dd1f2ecd123c9ce765ec06c7505e5 (diff)
parent1210e044c11ea7d41717398ab4a91c151c15992c (diff)
Merge branch 'develop' of http://gitlab.pmf.kg.ac.rs/BrzoDoLokacije2022/odyssey/brzodolokacije into develop
Diffstat (limited to 'Backend/Api/Api/Controllers/AuthController.cs')
-rw-r--r--Backend/Api/Api/Controllers/AuthController.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Backend/Api/Api/Controllers/AuthController.cs b/Backend/Api/Api/Controllers/AuthController.cs
index abb7adc..b63665b 100644
--- a/Backend/Api/Api/Controllers/AuthController.cs
+++ b/Backend/Api/Api/Controllers/AuthController.cs
@@ -120,5 +120,15 @@ namespace Api.Controllers
return base.Content(html, "text/html");
}
}
+ [HttpGet("jwttoid")]
+ [Authorize(Roles = "User")]
+ public async Task<ActionResult<string>> JwtToUserId()
+ {
+ var userid = await _userService.UserIdFromJwt();
+ if (userid != null)
+ return Ok(userid);
+ return BadRequest();
+ }
+
}
}