Skip to content

Commit

Permalink
Revert change and update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPoppe committed May 2, 2024
1 parent 22291a9 commit b66e41b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions CASAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ public function redcap_survey_page_top(
}
} catch ( \Throwable $e ) {
$this->framework->log('CAS Authenticator: Error', [ 'error' => $e->getMessage() ]);
$this->framework->exitAfterHook();
return;
} finally {
if ( $id === false ) {
if ( $id === false || empty($id) ) {
$this->framework->exitAfterHook();
return;
}
Expand Down Expand Up @@ -217,9 +215,8 @@ private function handleDashboard($dashboard_hash)
}
} catch ( \Throwable $e ) {
$this->framework->log('CAS Authenticator: Error', [ 'error' => $e->getMessage() ]);
$this->framework->exitAfterHook();
} finally {
if ( $id === false ) {
if ( $id === false || empty($id) ) {
$this->framework->exitAfterHook();
return;
}
Expand Down Expand Up @@ -265,9 +262,8 @@ private function handleReport($report_hash)
}
} catch ( \Throwable $e ) {
$this->framework->log('CAS Authenticator: Error', [ 'error' => $e->getMessage() ]);
$this->framework->exitAfterHook();
} finally {
if ( $id === false ) {
if ( $id === false || empty($id) ) {
$this->framework->exitAfterHook();
return;
}
Expand Down Expand Up @@ -325,9 +321,8 @@ private function handleFile ($file_hash) {
}
} catch ( \Throwable $e ) {
$this->framework->log('CAS Authenticator: Error', [ 'error' => $e->getMessage() ]);
$this->framework->exitAfterHook();
} finally {
if ( $id === false ) {
if ( $id === false || empty($id) ) {
$this->framework->exitAfterHook();
return;
}
Expand Down Expand Up @@ -526,7 +521,7 @@ private function initializeCas()
\phpCAS::setCasServerCACert($cas_server_ca_cert_path);

// Don't exit, let me handle instead
//\CAS_GracefullTerminationException::throwInsteadOfExiting();
\CAS_GracefullTerminationException::throwInsteadOfExiting();
return true;
} catch ( \Throwable $e ) {
$this->log('CAS Authenticator: Error initializing CAS', [ 'error' => $e->getMessage() ]);
Expand Down

0 comments on commit b66e41b

Please sign in to comment.