mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 06:29:37 +00:00
Convert TS to JS
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const token = async () => {
|
||||
return 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;
|
||||
} else {
|
||||
console.log('Getting a new token failed');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export default token;
|
||||
Reference in New Issue
Block a user