8000 [Security] NullToken signature by jderusse · Pull Request #40758 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] NullToken signature #40758

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

Merged
merged 1 commit into from
May 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getCredentials()

public function getUser()
{
return null;
return '';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we throw an exception here like we do in setUser?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most callers have if (!token->getUser() instanceof UserInterface) checks, I think it's good as is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of mixed on this, if you have multiple user "types" e.g. User & Token - it's easier to catch an exception. Which in turn falls in line with how the new security system handles $userBadge->getUser() || $passport->getUser().

}

public function setUser($user)
Expand Down
0