mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
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:
@@ -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'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ describe('POST /api/v1/cloud-tokens/{uuid}/validate', function () {
|
||||
])->postJson("/api/v1/cloud-tokens/{$token->uuid}/validate");
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertJson(['valid' => false, 'message' => 'Token is invalid.']);
|
||||
$response->assertJson(['valid' => false, 'message' => 'Invalid hetzner token. Please check your API token.']);
|
||||
});
|
||||
|
||||
test('validates a valid DigitalOcean token', function () {
|
||||
|
||||
Reference in New Issue
Block a user