Browse Source

fix(gui): avoid unnecessary `/me` api calls

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3655/head
Pranav C 2 years ago
parent
commit
36918d1b11
  1. 2
      packages/nc-gui/middleware/auth.global.ts

2
packages/nc-gui/middleware/auth.global.ts

@ -69,7 +69,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
}
} else {
/** if users are accessing the projects without having enough permissions, redirect to My Projects page */
if (to.params.projectId) {
if (to.params.projectId && from.params.projectId !== to.params.projectId) {
const user = await api.auth.me({ project_id: to?.params?.projectId as string })
if (user?.roles?.user) {
message.error("You don't have enough permission to access the project.")

Loading…
Cancel
Save