diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d7b5974..43f920f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -92,7 +92,7 @@ jobs: cache-from: type=gha,scope=${{ matrix.arch }} cache-to: type=gha,mode=max,scope=${{ matrix.arch }} provenance: false - outputs: type=image,name=${{ env.REGISTRY }}/${{ needs.prepare.outputs.image_name }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=${{ env.REGISTRY }}/${{ needs.prepare.outputs.image_name }},${{ env.REGISTRY }}/${{ needs.prepare.outputs.legacy_image_name }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | diff --git a/docs-site/docs/deploy/local-development.md b/docs-site/docs/deploy/local-development.md index 6b6b71b..dedc337 100644 --- a/docs-site/docs/deploy/local-development.md +++ b/docs-site/docs/deploy/local-development.md @@ -63,7 +63,7 @@ Set `WHISPER_CPP_BIN` in your `.env` to enable word-by-word highlighting. ```bash git clone https://github.com/richardr1126/openreader.git -cd OpenReader +cd openreader ``` 2. Install dependencies. diff --git a/src/app/api/documents/library/route.ts b/src/app/api/documents/library/route.ts index 7d428bc..72741f0 100644 --- a/src/app/api/documents/library/route.ts +++ b/src/app/api/documents/library/route.ts @@ -105,9 +105,14 @@ async function scanLibraryRoot(root: string, rootIndex: number, limit: number): export async function GET(req: NextRequest) { // Auth check - require session - const session = await auth?.api.getSession({ headers: req.headers }); - if (auth && !session?.user) { - return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }); + try { + const session = await auth?.api.getSession({ headers: req.headers }); + if (auth && !session?.user) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }); + } + } catch (error) { + console.error('Error checking auth:', error); + return NextResponse.json({ error: 'Error checking auth' }, { status: 500 }); } const url = new URL(req.url); diff --git a/src/components/auth/ClaimDataModal.tsx b/src/components/auth/ClaimDataModal.tsx index 1ffbce7..b52b137 100644 --- a/src/components/auth/ClaimDataModal.tsx +++ b/src/components/auth/ClaimDataModal.tsx @@ -43,6 +43,7 @@ export default function ClaimDataModal() { progress: 0, }); const user = sessionData?.user; + const userId = user?.id; const checkClaimableData = useCallback(async () => { setHasChecked(true); @@ -66,11 +67,16 @@ export default function ClaimDataModal() { }, []); useEffect(() => { - // Only check once per session if user is logged in (non-anonymous) - if (user && !user.isAnonymous && !hasChecked) { + // Reset per-user guard so account switches trigger a fresh check. + setHasChecked(false); + }, [userId]); + + useEffect(() => { + // Only check once per authenticated user + if (userId && !user?.isAnonymous && !hasChecked) { checkClaimableData(); } - }, [user, hasChecked, checkClaimableData]); + }, [userId, user?.isAnonymous, hasChecked, checkClaimableData]); const handleClaim = async () => { setIsClaiming(true);