Skip to content

Commit f6b1f16

Browse files
Copilotshyim
andauthored
Fix auto-login failure when DATABASE_URL uses default port 3306 (#36)
* Initial plan * Fix auto-login by casting port to int before comparison Cast port to int before strict comparison to handle type coercion from rawurldecode. This ensures the default MySQL port 3306 is correctly detected regardless of type, preventing session key mismatch between storage and lookup. Co-authored-by: shyim <6224096+shyim@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shyim <6224096+shyim@users.noreply.github.com>
1 parent 9150c5f commit f6b1f16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Controller/AdminerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function login(Request $request): JsonResponse
3535
$_SESSION["pwds"]['server'][$credentials['host']][$credentials['user']] = $credentials['pass'];
3636

3737
$host = $credentials['host'];
38-
if (!empty($credentials['port']) && $credentials['port'] !== 3306) {
38+
if (!empty($credentials['port']) && (int)$credentials['port'] !== 3306) {
3939
$host .= ':' . $credentials['port'];
4040
}
4141

0 commit comments

Comments
 (0)