diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-10 01:00:55 +0100 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-10 01:00:55 +0100 |
commit | 400f0d32b919da62efd9e26d0fa7f506904f0073 (patch) | |
tree | c7d7b30ed99c091b0fc5b47d6b50b8017b40aec1 /backend | |
parent | ff97a3c62ab764e35df4928cf87709088e2b4c8b (diff) | |
parent | a6f994c8bcd6949c186fe4209ad5a5f5f9f58eb5 (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.cs | 7 | ||||
-rw-r--r-- | backend/api/api/Controllers/UserController.cs | 2 | ||||
-rw-r--r-- | backend/api/api/Services/UserService.cs | 8 | ||||
-rw-r--r-- | backend/api/api/appsettings.json | 1 |
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", |