feat(frontend): Finalize auth refactor, routing, and resolve all code review findings
This commit is contained in:
@@ -38,6 +38,11 @@ export const AuthService = {
|
||||
|
||||
async getMe(): Promise<UserResponse> {
|
||||
const response = await api.get<UserResponse>("/auth/me")
|
||||
// Double check that we got JSON and not an HTML fallback
|
||||
const contentType = response.headers["content-type"]
|
||||
if (contentType && !contentType.includes("application/json")) {
|
||||
throw new Error("Invalid response from server")
|
||||
}
|
||||
return response.data
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user