issue fix

This commit is contained in:
Gowtham M 2025-10-09 15:30:34 +05:30
parent 1fa8c4cfd2
commit c4cc7feb0a
2 changed files with 134 additions and 120 deletions

View File

@ -399,6 +399,10 @@ class AuthController extends ResourceController
// Generate JWT Token // Generate JWT Token
$token = generateJWT($user); $token = generateJWT($user);
// Store the token in DB for current session
$this->userModel->update($user['user_id'], [
'current_token' => $token
]);
return $this->respond([ return $this->respond([
'status' => 200, 'status' => 200,

View File

@ -532,6 +532,16 @@ class PlanController extends ResourceController
return $this->respond(['status' => 'success', 'plan_id' => $planId]); return $this->respond(['status' => 'success', 'plan_id' => $planId]);
} catch (\Exception $e) { } catch (\Exception $e) {
// Log detailed error
log_message('error', sprintf("%s Exception caught in %s (line %d): %s\nTrace:\n%s",
'createOrUpdatePlan - ',
$e->getFile(),
$e->getLine(),
$e->getMessage(),
$e->getTraceAsString()
));
return $this->failServerError('Failed to create : ' . $e->getMessage()); return $this->failServerError('Failed to create : ' . $e->getMessage());
} }
} }