feat: Improve OAuth handling and user data extraction in authentication flow

This commit is contained in:
M1ngdaXie
2026-01-08 16:35:38 -08:00
parent 0a5e6661f1
commit 6ba18854bf
5 changed files with 205 additions and 178 deletions

View File

@@ -15,9 +15,10 @@ const Home = () => {
const loadDocuments = async () => {
try {
const { documents } = await documentsApi.list();
setDocuments(documents);
setDocuments(documents || []);
} catch (error) {
console.error("Failed to load documents:", error);
setDocuments([]); // Set empty array on error to prevent null access
} finally {
setLoading(false);
}