diff --git a/login-debug.php b/login-debug.php new file mode 100644 index 0000000000000000000000000000000000000000..dd782ff3c429253e1252df370964833f8436cc46 --- /dev/null +++ b/login-debug.php @@ -0,0 +1,40 @@ +<?php +/* +* Plugin Name: A/I - Debug login issues +* Plugin URI: +* Description: Debug login issues +* Version: 0.0.1 +* Author: Autistici/Inventati +* Author URI: https://autistici.org +**/ + +function debug_login_auth_cookie_malformed($cookie, $scheme) { + error_log("LOGIN: auth_cookie_malformed: scheme={$scheme} cookie={$cookie}"); +} +add_action('auth_cookie_malformed', 'debug_login_auth_cookie_malformed', 10, 2); + +function debug_login_auth_cookie_expired($cookie_elements) { + $username = $cookie_elements['username']; + error_log("LOGIN: auth_cookie_expired: username={$username}"); +} +add_action('auth_cookie_expired', 'debug_login_auth_cookie_expired'); + +function debug_login_auth_cookie_bad_username($cookie_elements) { + $username = $cookie_elements['username']; + error_log("LOGIN: auth_cookie_bad_username: username={$username}"); +} +add_action('auth_cookie_bad_username', 'debug_login_auth_cookie_bad_username'); + +function debug_login_auth_cookie_bad_hash($cookie_elements) { + $username = $cookie_elements['username']; + $token = $cookie_elements['token']; + error_log("LOGIN: auth_cookie_bad_hash: username={$username} token={$token}"); +} +add_action('auth_cookie_bad_hash', 'debug_login_auth_cookie_bad_hash'); + +function debug_login_auth_cookie_bad_session_token($cookie_elements) { + $username = $cookie_elements['username']; + $token = $cookie_elements['token']; + error_log("LOGIN: auth_cookie_bad_session_token: username={$username} token={$token}"); +} +add_action('auth_cookie_bad_session_token', 'debug_login_auth_cookie_bad_session_token');