diff --git a/Distribution/Features/DeliveryRide/DeliveryTaskController.cs b/Distribution/Features/DeliveryRide/DeliveryTaskController.cs index d0039a1..f48bb5d 100644 --- a/Distribution/Features/DeliveryRide/DeliveryTaskController.cs +++ b/Distribution/Features/DeliveryRide/DeliveryTaskController.cs @@ -1,3 +1,4 @@ +using Distribution.Infra.Authorization; using Distribution.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/distribution_fe/app/(auth)/login/page.tsx b/distribution_fe/app/(auth)/login/page.tsx index bc0c48b..a89d869 100644 --- a/distribution_fe/app/(auth)/login/page.tsx +++ b/distribution_fe/app/(auth)/login/page.tsx @@ -48,8 +48,8 @@ export default function LoginPage() { setIdentifier(e.target.value)} diff --git a/distribution_fe/contexts/auth-context.tsx b/distribution_fe/contexts/auth-context.tsx index 716e018..774f515 100644 --- a/distribution_fe/contexts/auth-context.tsx +++ b/distribution_fe/contexts/auth-context.tsx @@ -81,9 +81,13 @@ export function AuthProvider({ children }: { children: ReactNode }) { async function login(identifier: string, password: string) { const { data: loginData } = await api.post<{ profile: User }>('/auth/login', { identifier, password, deviceName: 'Web' }) setUser(loginData.profile) - const { data: permData } = await api.get<{ permissions: string[] }>('/authorization/my-permissions') - savePermissions(permData.permissions) - setPermissions(new Set(permData.permissions)) + try { + const { data: permData } = await api.get<{ permissions: string[] }>('/authorization/my-permissions') + savePermissions(permData.permissions) + setPermissions(new Set(permData.permissions)) + } catch { + // permissions unavailable — user is still authenticated + } router.push('/') } diff --git a/distribution_fe/package-lock.json b/distribution_fe/package-lock.json index b542fcb..e30f963 100644 --- a/distribution_fe/package-lock.json +++ b/distribution_fe/package-lock.json @@ -28,7 +28,7 @@ "react-grid-layout": "^2.2.4", "react-hook-form": "^7.86.0", "react-leaflet": "^5.0.0", - "recharts": "^3.8.0", + "recharts": "^3.10.1", "shadcn": "^4.19.0", "tailwind-merge": "^3.6.0", "tw-animate-css": "^1.4.0", @@ -2067,16 +2067,6 @@ } } }, - "node_modules/@reduxjs/toolkit/node_modules/immer": { - "version": "11.1.21", - "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.21.tgz", - "integrity": "sha512-bZSadeCPGdaY5/qRLgr6mDSH1ra21rD3rqpiWk7+QTr4ayYPTE9qZYdLh/NdPhMe0wSrTvHD/Lk8q5EwhUs0aw==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/immer" - } - }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -6644,9 +6634,9 @@ "license": "MIT" }, "node_modules/immer": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz", - "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==", + "version": "11.1.21", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.21.tgz", + "integrity": "sha512-bZSadeCPGdaY5/qRLgr6mDSH1ra21rD3rqpiWk7+QTr4ayYPTE9qZYdLh/NdPhMe0wSrTvHD/Lk8q5EwhUs0aw==", "license": "MIT", "funding": { "type": "opencollective", @@ -9537,9 +9527,9 @@ } }, "node_modules/recharts": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.8.0.tgz", - "integrity": "sha512-Z/m38DX3L73ExO4Tpc9/iZWHmHnlzWG4njQbxsF5aSjwqmHNDDIm0rdEBArkwsBvR8U6EirlEHiQNYWCVh9sGQ==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.10.1.tgz", + "integrity": "sha512-QXFrvt6IVcw7eeZCoyXTwkIJAX3Dv1nyVhMicXJ47GsGDDpcN8z6o644DibE9XjpBTThtsomLKnTV6lc+cVFUA==", "license": "MIT", "workspaces": [ "www" @@ -9550,9 +9540,9 @@ "decimal.js-light": "^2.5.1", "es-toolkit": "^1.39.3", "eventemitter3": "^5.0.1", - "immer": "^10.1.1", + "immer": "^11.1.8", "react-redux": "8.x.x || 9.x.x", - "reselect": "5.1.1", + "reselect": "5.2.0", "tiny-invariant": "^1.3.3", "use-sync-external-store": "^1.2.2", "victory-vendor": "^37.0.2" @@ -9567,9 +9557,9 @@ } }, "node_modules/recharts/node_modules/reselect": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", - "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.2.0.tgz", + "integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==", "license": "MIT" }, "node_modules/redux": { diff --git a/distribution_fe/package.json b/distribution_fe/package.json index 5aace42..4dddcdc 100644 --- a/distribution_fe/package.json +++ b/distribution_fe/package.json @@ -32,7 +32,7 @@ "react-grid-layout": "^2.2.4", "react-hook-form": "^7.86.0", "react-leaflet": "^5.0.0", - "recharts": "^3.8.0", + "recharts": "^3.10.1", "shadcn": "^4.19.0", "tailwind-merge": "^3.6.0", "tw-animate-css": "^1.4.0",