Skip to content

Same identity from different namespaces #46

@PavelWeirich

Description

@PavelWeirich

In version 3.03 (https://github.com/nette/security/releases/tag/v3.0.3) the identity and authenticated state are cached.
But it makes problem if you want to switch between namespaces.

For example in FrontModule\BasePresenter.php:
public function startup()
{
parent::startup();

$this->getUser()->getStorage()->setNamespace('admin');
$id = $this->getUser()->getId();

$this->getUser()->getStorage()->setNamespace('front');
$id = $this->getUser()->getId();

}

It always return ID from "admin" namespace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions