Skip to content

Commit bc7b2f6

Browse files
committed
chore: add debug info
fix: check non empty Change-Id: I243d0b6162ff8271d63c639094891a079577c61c
1 parent 8fa81ba commit bc7b2f6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

app/libs/OAuth2/Strategies/LoginHintProcessStrategy.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,36 @@ public function __construct(IAuthService $auth_service, ISecurityContextService
5050
* @return int|string|null
5151
*/
5252
private function getLoginHint(){
53+
5354
$ctx = $this->security_context_service->get();
5455
$Login_hint = null;
5556
if(!is_null($ctx)) {
5657
$Login_hint = $ctx->getRequestedUserId();
5758
}
5859

59-
if(is_null($Login_hint)){
60+
if(empty($Login_hint)){
61+
Log::debug
62+
(
63+
sprintf
64+
(
65+
"LoginHintProcessStrategy::getLoginHint no login hint in security context, trying to get from QS"
66+
)
67+
);
68+
6069
if(Request::has(OAuth2Protocol::OAuth2Protocol_LoginHint)) {
6170
$login_hint = Request::query(OAuth2Protocol::OAuth2Protocol_LoginHint);
62-
if (!EmailUtils::isValidEmail($login_hint))
71+
Log::debug(sprintf("LoginHintProcessStrategy::getLoginHint login_hint %s from QS", $login_hint));
72+
if (!EmailUtils::isValidEmail($login_hint)) {
73+
Log::debug
74+
(
75+
sprintf
76+
(
77+
"LoginHintProcessStrategy::getLoginHint login_hint %s is not a valid email",
78+
$login_hint
79+
)
80+
);
6381
$login_hint = null;
82+
}
6483
}
6584
}
6685

@@ -69,6 +88,7 @@ private function getLoginHint(){
6988

7089
public function process():void{
7190
$login_hint = $this->getLoginHint();
91+
Log::debug(sprintf("LoginHintProcessStrategy::process login_hint %s", $login_hint));
7292
// login hint processing
7393
Session::forget(['username', 'user_fullname', 'user_pic', 'user_verified']);
7494
if (!is_null($login_hint)) {

0 commit comments

Comments
 (0)