diff --git a/bbs/urls.py b/bbs/urls.py index 01a728e..ed781fc 100644 --- a/bbs/urls.py +++ b/bbs/urls.py @@ -18,7 +18,12 @@ urlpatterns = [ path("inventory/add/", spa_index), path("report", spa_index, name="report"), path("report/", spa_index), - path("accounts/login/", LoginView.as_view(), name="django.contrib.auth.views.login"), + # bbs has no login template of its own; the admin's works for any user + path( + "accounts/login/", + LoginView.as_view(template_name="admin/login.html", extra_context={"site_header": "BBS"}), + name="django.contrib.auth.views.login", + ), path( "accounts/logout/", LogoutView.as_view(), diff --git a/frontend/src/features/inventory/InventoryAdd.tsx b/frontend/src/features/inventory/InventoryAdd.tsx index 121ac4a..fdda556 100644 --- a/frontend/src/features/inventory/InventoryAdd.tsx +++ b/frontend/src/features/inventory/InventoryAdd.tsx @@ -7,6 +7,8 @@ import { GQLError } from "../../components/GQLError"; import { useToast } from "../../hooks/useToast"; import { CreateInventoryTransactionDocument, InventoryProductsDocument } from "../../types"; +const LOGIN_URL = `${import.meta.env.VITE_API_URL}/accounts/login/?next=/inventory/add`; + const InventoryAdd = () => { const navigate = useNavigate(); const { showToast } = useToast(); @@ -55,7 +57,7 @@ const InventoryAdd = () => {

Registrer varetransaksjon

- Du må være innlogget for å registrere varer. Logg inn. + Du må være innlogget for å registrere varer. Logg inn.