Secure UserProfileView with login_required
This commit is contained in:
parent
3af67fee01
commit
338afcc556
|
@ -1,7 +1,7 @@
|
||||||
import flask
|
import flask
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
from flask.views import View
|
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.forms import LoginForm
|
||||||
from ereuse_devicehub.resources.user.models import User
|
from ereuse_devicehub.resources.user.models import User
|
||||||
|
@ -33,6 +33,7 @@ class LoginView(View):
|
||||||
|
|
||||||
|
|
||||||
class UserProfileView(View):
|
class UserProfileView(View):
|
||||||
|
decorators = [login_required]
|
||||||
template_name = 'ereuse_devicehub/user_profile.html'
|
template_name = 'ereuse_devicehub/user_profile.html'
|
||||||
|
|
||||||
def dispatch_request(self):
|
def dispatch_request(self):
|
||||||
|
|
Reference in New Issue