Welcome Guest, Not a member yet? Register   Sign In
Filter controller without authentication
#8

When I was doing this, I had an exclusion list that would be checked first, if the controller/method was in the exclusion list, the filter was finished and processing stopped.

Something like this...

PHP Code:
        $current = (string)current_url(true)->setHost('')->setScheme('')->stripQuery('token');

        // the array must be all methods that do NOT require being checked
        if (in_array((string)$current, ['/controller/method1''/controller/method2']))
        {
            return;
        

You can of course add as many controller/method items to the exclusion array.

Put any must do filter code after this snippet. It will then exit if necessary or allow the processing as necessary.
Reply


Messages In This Thread
RE: Filter controller without authentication - by Chroma - 08-27-2020, 04:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB