File tree Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,18 @@ public function signTerms(int $termId): DataResponse {
102102 /**
103103 * As a guest sign the terms
104104 *
105- * @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
105+ * @return DataResponse<Http::STATUS_OK|Http::STATUS_NOT_ACCEPTABLE , list<empty>, array{}>
106106 *
107107 * 200: Signed successfully
108+ * 406: The user is already authenticated and therefore not allowed to sign the terms through this endpoint
108109 */
109110 #[PublicPage]
110111 #[UseSession]
111112 public function signTermsPublic (): DataResponse {
113+ if ($ this ->userId !== null ) {
114+ return new DataResponse ([], Http::STATUS_NOT_ACCEPTABLE );
115+ }
116+
112117 $ uuid = $ this ->config ->getAppValue (Application::APPNAME , 'term_uuid ' , '' );
113118 $ this ->session ->set ('term_uuid ' , $ uuid );
114119
Original file line number Diff line number Diff line change 542542 }
543543 }
544544 }
545+ },
546+ "406" : {
547+ "description" : " The user is already authenticated and therefore not allowed to sign the terms through this endpoint" ,
548+ "content" : {
549+ "application/json" : {
550+ "schema" : {
551+ "type" : " object" ,
552+ "required" : [
553+ " ocs"
554+ ],
555+ "properties" : {
556+ "ocs" : {
557+ "type" : " object" ,
558+ "required" : [
559+ " meta" ,
560+ " data"
561+ ],
562+ "properties" : {
563+ "meta" : {
564+ "$ref" : " #/components/schemas/OCSMeta"
565+ },
566+ "data" : {}
567+ }
568+ }
569+ }
570+ }
571+ }
572+ }
545573 }
546574 }
547575 }
Original file line number Diff line number Diff line change 323323 }
324324 }
325325 }
326+ },
327+ "406" : {
328+ "description" : " The user is already authenticated and therefore not allowed to sign the terms through this endpoint" ,
329+ "content" : {
330+ "application/json" : {
331+ "schema" : {
332+ "type" : " object" ,
333+ "required" : [
334+ " ocs"
335+ ],
336+ "properties" : {
337+ "ocs" : {
338+ "type" : " object" ,
339+ "required" : [
340+ " meta" ,
341+ " data"
342+ ],
343+ "properties" : {
344+ "meta" : {
345+ "$ref" : " #/components/schemas/OCSMeta"
346+ },
347+ "data" : {}
348+ }
349+ }
350+ }
351+ }
352+ }
353+ }
326354 }
327355 }
328356 }
You can’t perform that action at this time.
0 commit comments