From 338afcc556ffd6db3a3d5c183e8d3f4f374e1458 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 28 Dec 2021 09:44:04 +0100 Subject: [PATCH] Secure UserProfileView with login_required --- ereuse_devicehub/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/views.py b/ereuse_devicehub/views.py index 15e7d3e5..3c5b28d0 100644 --- a/ereuse_devicehub/views.py +++ b/ereuse_devicehub/views.py @@ -1,7 +1,7 @@ import flask from flask import Blueprint from flask.views import View -from flask_login import login_user +from flask_login import login_required, login_user from ereuse_devicehub.forms import LoginForm from ereuse_devicehub.resources.user.models import User @@ -33,6 +33,7 @@ class LoginView(View): class UserProfileView(View): + decorators = [login_required] template_name = 'ereuse_devicehub/user_profile.html' def dispatch_request(self):