Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding functionality to allow accessing authenticated user outside of… #52

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Commits on Dec 13, 2017

  1. Adding functionality to allow accessing authenticated user outside of…

    … superglobal(s).
    
    Currently, the middleware authenticates, but retrieving the authenticated user
    is still done via $_SERVER["PHP_AUTH_USER"] or $request->getServerParams()["PHP_AUTH_USER"].
    
    There is something unnatural about both, as with any framework you're normally
     not directly interacting with any of the superglobals, or their variables.
    IE you access $request->getUri()->getPath() in the application, rather than
    $_SERVER["REQUEST_URI"] , or $request->getServerParams()["REQUEST_URI"].
    
    With this PR, you will be able to access the authenticated user with
    $request->getAttribute("authorized_user") in your route, or other middleware ( IE ACL ),
    and the attribute name is customizable through the existing options, which the
    README has been updated to provide clarity on.
    conrad10781 committed Dec 13, 2017
    Configuration menu
    Copy the full SHA
    812fa7d View commit details
    Browse the repository at this point in the history