@@ -393,6 +393,7 @@ public function resendVerificationEmail(LaravelRequest $request)
393393 public function postLogin ()
394394 {
395395 $ max_login_attempts_2_show_captcha = $ this ->server_configuration_service ->getConfigValue ("MaxFailed.LoginAttempts.2ShowCaptcha " );
396+ $ max_login_failed_attempts = intval ($ this ->server_configuration_service ->getConfigValue ("MaxFailed.Login.Attempts " ));
396397 $ login_attempts = 0 ;
397398 $ username = '' ;
398399 $ user = null ;
@@ -479,13 +480,15 @@ public function postLogin()
479480 (
480481 [
481482 'max_login_attempts_2_show_captcha ' => $ max_login_attempts_2_show_captcha ,
483+ 'max_login_failed_attempts ' => $ max_login_failed_attempts ,
482484 'login_attempts ' => $ login_attempts ,
483485 'error_message ' => $ ex ->getMessage (),
484486 'user_fullname ' => !is_null ($ user ) ? $ user ->getFullName () : "" ,
485487 'user_pic ' => !is_null ($ user ) ? $ user ->getPic (): "" ,
486488 'user_verified ' => true ,
487489 'username ' => $ username ,
488- 'flow ' => $ flow
490+ 'flow ' => $ flow ,
491+ 'user_is_active ' => !is_null ($ user ) ? ($ user ->isActive () ? 1 : 0 ) : 0
489492 ]
490493 );
491494 }
@@ -495,6 +498,7 @@ public function postLogin()
495498 // validator errors
496499 $ response_data = [
497500 'max_login_attempts_2_show_captcha ' => $ max_login_attempts_2_show_captcha ,
501+ 'max_login_failed_attempts ' => $ max_login_failed_attempts ,
498502 'login_attempts ' => $ login_attempts ,
499503 'validator ' => $ validator ,
500504 ];
@@ -506,7 +510,8 @@ public function postLogin()
506510 if (!is_null ($ user )){
507511 $ response_data ['user_fullname ' ] = $ user ->getFullName ();
508512 $ response_data ['user_pic ' ] = $ user ->getPic ();
509- $ response_data ['user_verified ' ] = true ;
513+ $ response_data ['user_verified ' ] = 1 ;
514+ $ response_data ['user_is_active ' ] = $ user ->isActive () ? 1 : 0 ;
510515 }
511516
512517 return $ this ->login_strategy ->errorLogin
@@ -521,9 +526,10 @@ public function postLogin()
521526
522527 $ response_data = [
523528 'max_login_attempts_2_show_captcha ' => $ max_login_attempts_2_show_captcha ,
529+ 'max_login_failed_attempts ' => $ max_login_failed_attempts ,
524530 'login_attempts ' => $ login_attempts ,
525531 'username ' => $ username ,
526- 'error_message ' => $ ex1 ->getMessage ()
532+ 'error_message ' => $ ex1 ->getMessage (),
527533 ];
528534
529535 if (is_null ($ user ) && isset ($ data ['username ' ])) {
@@ -533,7 +539,8 @@ public function postLogin()
533539 if (!is_null ($ user )){
534540 $ response_data ['user_fullname ' ] = $ user ->getFullName ();
535541 $ response_data ['user_pic ' ] = $ user ->getPic ();
536- $ response_data ['user_verified ' ] = true ;
542+ $ response_data ['user_verified ' ] = 1 ;
543+ $ response_data ['user_is_active ' ] = $ user ->isActive () ? 1 : 0 ;
537544 }
538545
539546 return $ this ->login_strategy ->errorLogin
0 commit comments