leaky-ships/leaky-ships/lib/frontend/getAccessToken.ts

7 lines
No EOL
198 B
TypeScript

export default function getAccessToken(): Promise<string> {
return fetch('/api/auth', {
method: 'GET',
})
.then(res => res.json())
.then(res => res.newAccessToken)
}