mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 01:05:40 +00:00
17 lines
368 B
TypeScript
17 lines
368 B
TypeScript
const token = async () =>
|
|
fetch("/api/v1/auth/token", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
credentials: "include"
|
|
}).then(async (res) => {
|
|
if (res.status === 200) {
|
|
return (await res.json()).token;
|
|
}
|
|
console.log("Getting a new token failed");
|
|
return undefined;
|
|
});
|
|
|
|
export default token;
|