From 53ed6e0336f31645ef6e72a2d3c375c2e39bd05d Mon Sep 17 00:00:00 2001 From: Mona Eikli Andresen Date: Fri, 26 Sep 2025 14:47:53 +0200 Subject: [PATCH] registration hot fix --- exercise.wwwapi/Endpoints/UserEndpoints.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercise.wwwapi/Endpoints/UserEndpoints.cs b/exercise.wwwapi/Endpoints/UserEndpoints.cs index e3107d9..9e73ba7 100644 --- a/exercise.wwwapi/Endpoints/UserEndpoints.cs +++ b/exercise.wwwapi/Endpoints/UserEndpoints.cs @@ -340,8 +340,7 @@ public static async Task UpdateUser(IRepository userRepository, i { // Only teacher can edit protected fields var authorized = AuthorizeTeacher(claimsPrinciple); - if (!authorized && (request is not null - || request.Role is not null)) + if (!authorized && (request.Role is not null)) { return Results.Unauthorized(); }