fix: return actual error message from token validation endpoint

- Return the specific error from validateProviderToken() instead of
  generic "Failed to validate token." message
- Update test to expect the actual error message

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-10 13:22:53 +01:00
parent 596b1cb76e
commit 56394ba093
2 changed files with 2 additions and 2 deletions

View File

@@ -525,7 +525,7 @@ class CloudProviderTokensController extends Controller
return response()->json([
'valid' => $validation['valid'],
'message' => $validation['valid'] ? 'Token is valid.' : 'Failed to validate token.',
'message' => $validation['valid'] ? 'Token is valid.' : $validation['error'],
]);
}
}