Skip to content
Snippets Groups Projects
Commit 3c659642 authored by Jan Pokorný's avatar Jan Pokorný :lifter_tone2:
Browse files

getSubject

parent c5a3c93f
No related branches found
No related tags found
1 merge request!46LanguageSchool fixes + enrol expel rework
Pipeline #
......@@ -204,7 +204,7 @@ public class CourseController {
@ApiResponse(code = 404, message = "Course not found")
})
public ResponseEntity<CourseDto> enrol(@PathVariable Long id, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) throws JsonProcessingException {
String email = principal.getAttribute("sub");
String email = principal.getSubject();
return ResponseEntity.ok(courseFacade.enrol(id, email));
}
......@@ -241,7 +241,7 @@ public class CourseController {
@ApiResponse(code = 404, message = "Course not found")
})
public ResponseEntity<CourseDto> expel(@PathVariable Long id, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) throws JsonProcessingException {
String email = principal.getAttribute("sub");
String email = principal.getSubject();
return ResponseEntity.ok(courseFacade.expel(id, email));
}
......
......@@ -179,7 +179,7 @@ public class LectureController {
@ApiResponse(code = 404, message = "The lecture with the specified ID does not exist")
})
public ResponseEntity<LectureDto> enrol(@PathVariable Long id, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) throws JsonProcessingException {
String email = principal.getAttribute("sub");
String email = principal.getSubject();
return ResponseEntity.ok(lectureFacade.enrol(id, email));
}
......@@ -216,7 +216,7 @@ public class LectureController {
@ApiResponse(code = 404, message = "The lecture with the specified ID does not exist")
})
public ResponseEntity<LectureDto> expel(@PathVariable Long id, @AuthenticationPrincipal OAuth2IntrospectionAuthenticatedPrincipal principal) throws JsonProcessingException {
String email = principal.getAttribute("sub");
String email = principal.getSubject();
return ResponseEntity.ok(lectureFacade.expel(id, email));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment