| 1 | import { hubRequest } from "../api.js"; |
| 2 | |
| 3 | interface MeResponse { |
| 4 | user: { |
| 5 | id: number; |
| 6 | username: string; |
| 7 | display_name: string; |
| 8 | created_at: string; |
| 9 | }; |
| 10 | } |
| 11 | |
| 12 | export async function whoami() { |
| 13 | const { user } = await hubRequest<MeResponse>("/api/auth/me"); |
| 14 | console.log(user.username); |
| 15 | } |
| 16 |