Skip to content

Commit b641f89

Browse files
committed
web: Fix is_auth_user call when not auth_user
1 parent d5a651a commit b641f89

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

web/src/lib/api/user.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,15 @@ export async function exportUserData(user: User): Promise<{ text: string; errors
165165
}
166166

167167
export async function isAuthUser(user: User): Promise<boolean> {
168-
return unwrapEmptyResponse(
169-
await getUsersByUserIdIsAuthUser({
170-
path: { userId: user.id },
171-
}),
172-
);
168+
try {
169+
return unwrapEmptyResponse(
170+
await getUsersByUserIdIsAuthUser({
171+
path: { userId: user.id },
172+
}),
173+
);
174+
} catch {
175+
return false;
176+
}
173177
}
174178

175179
export async function getUser(id: string): Promise<User> {

0 commit comments

Comments
 (0)