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

Commit 588f782

Browse filesBrowse files
committed
Control to avoid an error when the request has no session.
1 parent 2ca1273 commit 588f782
Copy full SHA for 588f782

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎src/Symfony/Component/Security/Http/Session/RegisterSessionAuthenticationStrategy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Session/RegisterSessionAuthenticationStrategy.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public function __construct(SessionRegistry $registry)
3737
*/
3838
public function onAuthentication(Request $request, TokenInterface $token)
3939
{
40-
$this->registry->registerNewSession($request->getSession()->getId(), $token->getUsername());
40+
if ($session = $request->getSession()) {
41+
$this->registry->registerNewSession($session->getId(), $token->getUsername());
42+
}
4143
}
4244
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.