coolify/bootstrap/helpers/api.php

13 lines
296 B
PHP
Raw Normal View History

<?php
function get_team_id_from_token()
{
$token = auth()->user()->currentAccessToken();
2024-06-10 22:43:34 +02:00
return data_get($token, 'team_id');
}
2024-03-07 12:27:23 +01:00
function invalid_token()
{
2024-03-27 11:07:29 +01:00
return response()->json(['error' => 'Invalid token.', 'docs' => 'https://coolify.io/docs/api-reference/authorization'], 400);
2024-03-07 12:27:23 +01:00
}