Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security] [Guard] Improve comment with working example #19142

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

Closed
wants to merge 2 commits into from
Closed

[Security] [Guard] Improve comment with working example #19142

wants to merge 2 commits into from

Conversation

pasdeloup
Copy link
Contributor

Q A
Branch? 2.8
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Improve the code given in the comment to make it work.
If you follow blindly the previous example (as I did) and never return null, you're stucked in an infinite redirection loop on your login page.

* 'password' => $request->request->get('_password'),
* );
*
* if($request->request->has('_username')) {
Copy link
Member

Choose a reason for hiding this comment

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

CS needs a fix: space after if, and else on the same line as } (but is the else required?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry again for the CS, I should really forget my old habits and get used to real PSR-2...

For the else I want to emphasis on the fact that you should not forget to return null when you don't have credentials.

@fabpot
Copy link
Member

fabpot commented Jun 23, 2016

Thank you @pasdeloup.

fabpot added a commit that referenced this pull request Jun 23, 2016
…(pasdeloup)

This PR was squashed before being merged into the 2.8 branch (closes #19142).

Discussion
----------

[Security] [Guard] Improve comment with working example

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Improve the code given in the comment to make it work.
If you follow blindly the previous example (as I did) and never return null, you're stucked in an infinite redirection loop on your login page.

Commits
-------

b36fc32 [Security] [Guard] Improve comment with working example
@fabpot fabpot closed this Jun 23, 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.