Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[5.2] Fix seeAuthenticatedAs#13308

Merged
taylorotwell merged 1 commit into
laravel:5.2from
sileence:fix/5.2/seeIsAuthenticatedAs
Apr 27, 2016
Merged

[5.2] Fix seeAuthenticatedAs#13308
taylorotwell merged 1 commit into
laravel:5.2from
sileence:fix/5.2/seeIsAuthenticatedAs

Conversation

@sileence
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Yeah, that looks good to me.

@sileence
Copy link
Copy Markdown
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