The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

Authentication

Mike's Avatar

Mike

13 Sep, 2015 03:51 PM

Hi,
I'm partly using Brians code for authentication.
How could I authenticate users for $app->notFound() & $app->error()
I need to show different messages for authenticated users, and users outside thr private area.

Tnaks in advance!
Kind Regards,
Mike

  1. 1 Posted by Mike on 13 Sep, 2015 03:54 PM

    Mike's Avatar

    Not yet solved :)

  2. 2 Posted by Mike on 13 Sep, 2015 04:53 PM

    Mike's Avatar

    Just tried another solution with an optional wildcard:

    $app->get('/(:request+)', $authenticate($app), function () use($app) {
        $app->render('notfound.php');
    });

    An it seems to work perfectly for notFound() method.

    Any suggestions on how to use native notFound() method that way ???

    Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac