diff --git a/src/Http/Controllers/ServerController.php b/src/Http/Controllers/ServerController.php index 0de755b..083c07e 100755 --- a/src/Http/Controllers/ServerController.php +++ b/src/Http/Controllers/ServerController.php @@ -62,12 +62,12 @@ public function attach(Request $request): Response|JsonResponse|RedirectResponse $return_url = $request->input('return_url'); // Compare checksums - if (! $this->server->verifyAttachChecksum($broker_id, $token, $checksum)) { - - // Failed checksum comprehension + try { + $this->server->verifyAttachChecksum($broker_id, $token, $checksum); + } catch (\Exception $e) { return response(trans('passport::errors.invalid_checksum'), 400); } - + // Generate new session $sid = $this->server->generateSessionId($broker_id, $token);