TypeRocket / typerocket

TypeRocket is a highly integrated MVC WordPress framework with beautiful UI components for the modern developer.
https://typerocket.com
454 stars 62 forks source link

Editor unable to use search field in custom post type #248

Closed lukwi closed 2 years ago

lukwi commented 2 years ago

Hey Kevin,

an editor is not able to use a search field, which i have assigned to a custom post type:

echo $form->search('Thema')->setPostTypeOptions('thema');

Console says the following:

Failed to load resource: the server responded with a status of 401 (Unauthorized) /tr-api/search?post_type=thema&s=:1

Is there a way to enable search fields for editors?

Greetings

Lucas

kevindees commented 2 years ago

Hey @lukwi

You need to update the Kernel middleware for the search field. You can use AuthRead which is pretty open but not public. Or, you can create your own middleware for security.

Screen Shot 2022-02-14 at 3 26 56 PM
lukwi commented 2 years ago

Great! Thank you very much for the fast response!