coolify/bootstrap/helpers/api.php
2024-06-10 20:43:34 +00:00

13 lines
296 B
PHP

<?php
function get_team_id_from_token()
{
$token = auth()->user()->currentAccessToken();
return data_get($token, 'team_id');
}
function invalid_token()
{
return response()->json(['error' => 'Invalid token.', 'docs' => 'https://coolify.io/docs/api-reference/authorization'], 400);
}