mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 14:27:59 +00:00
27 lines
664 B
TypeScript
27 lines
664 B
TypeScript
import SecurityClient from '~/utilities/SecurityClient';
|
|
|
|
/**
|
|
* This route gets service tokens for a specific user in a project
|
|
* @param {*} param0
|
|
* @returns
|
|
*/
|
|
const getServiceTokens = ({ workspaceId }: { workspaceId: string }) => {
|
|
return SecurityClient.fetchCall(
|
|
'/api/v2/workspace/' + workspaceId + '/service-token-data',
|
|
{
|
|
method: 'GET',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
}
|
|
).then(async (res) => {
|
|
if (res && res.status == 200) {
|
|
return (await res.json()).serviceTokenData;
|
|
} else {
|
|
console.log('Failed to get service tokens');
|
|
}
|
|
});
|
|
};
|
|
|
|
export default getServiceTokens;
|