From 9b3f94eafcbdc5d0e3c7d04d04e816c28a0e6431 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 10 Aug 2020 22:13:42 +0100 Subject: [PATCH] :bug: Users table issue - fix exception catch blocks Signed-off-by: Luke Tainton --- app/public/actions/login.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/public/actions/login.php b/app/public/actions/login.php index aad4408..bdfe7fe 100644 --- a/app/public/actions/login.php +++ b/app/public/actions/login.php @@ -13,7 +13,7 @@ 'email' => $oidc->requestUserInfo('email'), ); } catch (Jumbojett\OpenIDConnectClientException $e) { - echo("Error during OpenID Connect authentication: " . $e->getMessage() . "
"); + $alert = array("danger", "Error during OpenID Connect authentication: " . $e->getMessage()); } // Check if the user already exists @@ -23,7 +23,7 @@ $user_exist_sql->execute(); $result = $user_exist_sql->setFetchMode(PDO::FETCH_ASSOC); // If user doesn't exist, $result will be null } catch (PDOException $e) { - echo("Error: " . $e->getMessage() . "
"); + $alert = array("danger", "Error during check for user record: " . $e->getMessage()); } if ($result != null) { @@ -38,7 +38,7 @@ $sql->bindParam(':email', $oidc_user['email']); $sql->execute(); } catch (PDOException $e) { - echo("Error running SQL (Update existing user):
" . $e->getMessage() . "
"); + $alert = array("danger", "Error during existing user record update: " . $e->getMessage()); } } else { // User doesn't already exist @@ -52,7 +52,7 @@ $sql->bindParam(':email', $oidc_user['email']); $sql->execute(); } catch (PDOException $e) { - echo("Error running SQL (Add new user):
" . $e->getMessage() . "
"); + $alert = array("danger", "Error during creation of new user record: " . $e->getMessage()); } }