aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-10 01:00:55 +0100
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-10 01:00:55 +0100
commit400f0d32b919da62efd9e26d0fa7f506904f0073 (patch)
treec7d7b30ed99c091b0fc5b47d6b50b8017b40aec1 /backend
parentff97a3c62ab764e35df4928cf87709088e2b4c8b (diff)
parenta6f994c8bcd6949c186fe4209ad5a5f5f9f58eb5 (diff)
Merge branch 'frontendCSV' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
# Conflicts: # backend/api/api/Controllers/UserController.cs # backend/api/api/Interfaces/IUserStoreDatabaseSettings.cs # backend/api/api/Services/IUserService.cs # backend/api/api/Services/UserService.cs # backend/api/api/appsettings.json
Diffstat (limited to 'backend')
-rw-r--r--backend/api/api/Controllers/AuthController.cs7
-rw-r--r--backend/api/api/Controllers/UserController.cs2
-rw-r--r--backend/api/api/Services/UserService.cs8
-rw-r--r--backend/api/api/appsettings.json1
4 files changed, 11 insertions, 7 deletions
diff --git a/backend/api/api/Controllers/AuthController.cs b/backend/api/api/Controllers/AuthController.cs
index 01354f87..e1601815 100644
--- a/backend/api/api/Controllers/AuthController.cs
+++ b/backend/api/api/Controllers/AuthController.cs
@@ -30,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");
+ }
+
}
diff --git a/backend/api/api/Controllers/UserController.cs b/backend/api/api/Controllers/UserController.cs
index 85f8218d..caf78d9c 100644
--- a/backend/api/api/Controllers/UserController.cs
+++ b/backend/api/api/Controllers/UserController.cs
@@ -37,6 +37,7 @@ namespace api.Controllers
return user;
}
+
// GET api/<UserController>/5
//potrebno za profile page
[HttpGet("{id}")]
@@ -49,6 +50,7 @@ namespace api.Controllers
return user;
}
+
// POST api/<UserController>
[HttpPost]
public ActionResult<User> Post([FromBody] User user)
diff --git a/backend/api/api/Services/UserService.cs b/backend/api/api/Services/UserService.cs
index e6f28e92..c626889d 100644
--- a/backend/api/api/Services/UserService.cs
+++ b/backend/api/api/Services/UserService.cs
@@ -23,6 +23,7 @@ namespace api.Services
{
return _users.Find(user => true).ToList();
}
+
public User GetUserUsername(string username)
{
return _users.Find(user => user.Username == username).FirstOrDefault();
@@ -54,7 +55,6 @@ namespace api.Services
"lastName" : "Ljubisavljevic"
}
-
{
"_id": {
"$oid": "62291140d88e6bcf95c96a58"
@@ -62,10 +62,6 @@ namespace api.Services
"uploaderId":"",
"extension" : "",
"name" : ""
-
-
}
-
-
-*/ \ No newline at end of file
+*/
diff --git a/backend/api/api/appsettings.json b/backend/api/api/appsettings.json
index b9bb665a..3661f171 100644
--- a/backend/api/api/appsettings.json
+++ b/backend/api/api/appsettings.json
@@ -14,7 +14,6 @@
"ConnectionString": "mongodb://127.0.0.1:27017/",
"DatabaseName": "si_project",
"CollectionName": "User"
-
*/
"ConnectionString": "mongodb+srv://si_user:si_user@sidatabase.twtfm.mongodb.net/myFirstDatabase?retryWrites=true&w=majority",
"DatabaseName": "si_db",