33 * @author : Jakiboy
44 * @package : FloatPHP
55 * @subpackage : Kernel Component
6- * @version : 1.2 .x
6+ * @version : 1.3 .x
77 * @copyright : (c) 2018 - 2024 Jihad Sinnaour <[email protected] > 88 * @link : https://floatphp.com
99 * @license : MIT
@@ -38,17 +38,17 @@ public function isAuthenticated() : bool
3838 }
3939 return false ;
4040 }
41-
41+
4242 /**
4343 * @access protected
4444 * @param AuthenticationInterface $auth
4545 * @param array $args
4646 * @return void
4747 */
48- protected function authenticate (AuthenticationInterface $ auth , array $ args = [])
48+ protected function authenticate (AuthenticationInterface $ auth , array $ args = []) : void
4949 {
5050 // Security
51- $ this ->verifyRequest (true );
51+ $ this ->verifyRequest (force: true );
5252
5353 // Get authentication
5454 $ args = $ this ->mergeArray ([
@@ -69,10 +69,10 @@ protected function authenticate(AuthenticationInterface $auth, array $args = [])
6969 if ( $ this ->isPassword ($ password , $ user ['password ' ]) ) {
7070
7171 // Check password format
72- if ( $ this ->applyFilter ('auth-strong-password ' , false ) ) {
72+ if ( $ this ->applyFilter ('auth-strong-pswd ' , false ) ) {
7373 if ( !$ this ->isStrongPassword ($ password ) ) {
7474 // Authenticate failed
75- $ msg = $ this ->applyFilter ('auth-password-message ' , 'Strong password required ' );
75+ $ msg = $ this ->applyFilter ('auth-pswd-msg ' , 'Strong password required ' );
7676 $ msg = $ this ->translate ($ msg );
7777 $ this ->setResponse ($ msg , [], 'warning ' );
7878 }
@@ -89,14 +89,14 @@ protected function authenticate(AuthenticationInterface $auth, array $args = [])
8989 if ( $ auth ->hasSecret ($ username ) ) {
9090 $ this ->setSession ('--verify ' , $ username );
9191 // Authenticate accepted
92- $ msg = $ this ->applyFilter ('auth-accepted-message ' , 'Accepted ' );
92+ $ msg = $ this ->applyFilter ('auth-accepted-msg ' , 'Accepted ' );
9393 $ msg = $ this ->translate ($ msg );
9494 $ this ->setResponse ($ msg , [], 'accepted ' , 202 );
9595
9696 } else {
97- $ this ->setSession ($ auth ->getKey (),$ user [$ auth ->getKey ()]);
97+ $ this ->setSession ($ auth ->getKey (), $ user [$ auth ->getKey ()]);
9898 // Authenticate success
99- $ msg = $ this ->applyFilter ('auth-success-message ' , 'Connected ' );
99+ $ msg = $ this ->applyFilter ('auth-success-msg ' , 'Connected ' );
100100 $ msg = $ this ->translate ($ msg );
101101 $ this ->setResponse ($ msg );
102102 }
@@ -111,7 +111,7 @@ protected function authenticate(AuthenticationInterface $auth, array $args = [])
111111 $ this ->doAction ('auth-failed ' , $ username );
112112
113113 // Authenticate failed
114- $ msg = $ this ->applyFilter ('auth-error-message ' , 'Authentication failed ' );
114+ $ msg = $ this ->applyFilter ('auth-error-msg ' , 'Authentication failed ' );
115115 $ msg = $ this ->translate ($ msg );
116116 $ this ->setResponse ($ msg , [], 'error ' , 401 );
117117 }
0 commit comments