pulilab / who-maps

WHO MAPS toolkit
3 stars 0 forks source link

[DA02-960] feature/Consolidate project page route guarding #1562

Closed TiborPL closed 1 year ago

TiborPL commented 1 year ago

Issue When navigating from or to a project, if any error happens (doesn’t matter if it’s a legit permission error or somthing else) it shows a general error message then tries to redirect to the published page. If project doesn’t have a published version, then user can’t navigate to the draft version at all. Page refresh solves it.

Solution Pass backend response to error page with proper status code and localised message, not just a general 404.

If backend returns 200, then check against the members and viewer list and if not, then redirect to published if there is a published version, otherwise throw error which ends up on error page with appropriate localized backend message. Take into account that depending on which is the current page