Skip to content

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Sep 17, 2025

Purpose

When users were reloading a 403 page, they were redirected to the 404 page because of Nextjs routing mechanism.
This PR fixes this issue by removing the 403 page from the pages directory and creating a component that is used directly in the layout when a 403 error is detected.

Proposal

  • 🐛(frontend) fix 404 page when reload 403 page
  • 🥅(frontend) improve meta 401 page
  • 🛂(frontend) invalidate doc query when lost connection

@AntoLC AntoLC self-assigned this Sep 17, 2025
@AntoLC AntoLC added bug Something isn't working enhancement improve an existing feature frontend labels Sep 17, 2025
@AntoLC AntoLC linked an issue Sep 17, 2025 that may be closed by this pull request
Copy link

github-actions bot commented Sep 17, 2025

Size Change: -2.88 kB (-0.08%)

Total Size: 3.65 MB

Filename Size Change
apps/impress/out/_next/static/chunks/8495.js 50.5 kB +669 B (+1.34%)
apps/impress/out/_next/static/chunks/pages/docs/[id]/403.js 0 B -2.1 kB (removed) 🏆
apps/impress/out/_next/static/d41c7039/_buildManifest.js 0 B -886 B (removed) 🏆
apps/impress/out/docs/[id]/403/index.html 0 B -1.29 kB (removed) 🏆
apps/impress/out/_next/static/2bf468a1/_buildManifest.js 863 B +863 B (new file) 🆕

compressed-size-action

@AntoLC AntoLC force-pushed the fix/403-redirect-404 branch 2 times, most recently from 8a3168d to aeb26bb Compare September 17, 2025 14:34
@AntoLC AntoLC requested a review from Ovgodd September 17, 2025 14:35
When users were reloading a 403 page, they were
redirected to the 404 page because of Nextjs
routing mechanism. This commit fixes this issue by
removing the 403 page from the pages directory
and creating a component that is used directly
in the layout when a 403 error is detected.
Add better meta for the 401 page.
When the provider reports a lost connection,
we invalidate the doc query to refetch the document
data.
This ensures that if a user has lost is rights
to access a document, he will be redirected
to a 403 page without needing to refresh the page.
@AntoLC AntoLC force-pushed the fix/403-redirect-404 branch from aeb26bb to fbdeb90 Compare September 17, 2025 15:46
Copy link
Collaborator

@Ovgodd Ovgodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@AntoLC AntoLC merged commit fbdeb90 into main Sep 18, 2025
21 of 22 checks passed
@AntoLC AntoLC deleted the fix/403-redirect-404 branch September 18, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement improve an existing feature frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 403 redirect to a 404 on prod environment

2 participants