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

[5.2] Fix seeAuthenticatedAs #13308

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

sileence
Copy link
Contributor

@sileence sileence commented Apr 25, 2016

Fix bug when seeAuthenticatedAs is called with a different user object than the user returned by Auth::user() even when they both represent the same user. I attempt to solve this problem comparing through getAuthIdentifier() instead of the objects directly.

@thecrypticace
Copy link
Contributor

This would not properly support the (probably small) case in which the user objects being compared are of different types. It could result in false positives if the objects have equa authentication identifiers (which is, by default, the primary key of the model).

Perhaps you should assert that the types are the same too?

@sileence sileence force-pushed the fix/5.2/seeIsAuthenticatedAs branch from b530361 to 921a4d9 Compare April 26, 2016 09:21
@sileence
Copy link
Contributor Author

sileence commented Apr 26, 2016

I think this should be fine now, what do you think @thecrypticace? And thank you for pointing out that possible scenario.

@thecrypticace
Copy link
Contributor

Yeah, that looks good to me.

@sileence
Copy link
Contributor Author

@GrahamCampbell or @taylorotwell can you please review and merge this today? (if everything is OK)

@taylorotwell taylorotwell merged commit b6735f7 into laravel:5.2 Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants