Skip to content

Commit

Permalink
Merge pull request #144 from MuhammadFaizanHaidar1/bypass-routes-exce…
Browse files Browse the repository at this point in the history
…pt-tangible

Only validate token for REST endpoints with namespace tangible
  • Loading branch information
eliot-akira authored Jan 7, 2025
2 parents 8de614a + 043f2b1 commit d8dc342
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions framework/api/rest/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,12 @@ function reset_password( $request ) {
* Provide current user to the request.
*/
function rest_pre_dispatch( $result, $server, $request ) {
// Check if this is a Loops & Logic endpoint.
if ( strpos( $request->get_route(), '/' . $this->namespace ) === false ) {

return false; // Not our endpoint, skip validation.

}
if ($request->get_route() !== '/' . $this->namespace . '/token/validate'
&& !empty($user_id = $this->determine_current_user())
&& !is_user_logged_in()
Expand Down

0 comments on commit d8dc342

Please sign in to comment.