|
|
@ -13,11 +13,11 @@ bp = Blueprint('auth', __name__, url_prefix='/auth') |
|
|
|
def login_required(view): |
|
|
|
def login_required(view): |
|
|
|
"""View decorator that redirects anonymous users to the login page.""" |
|
|
|
"""View decorator that redirects anonymous users to the login page.""" |
|
|
|
@functools.wraps(view) |
|
|
|
@functools.wraps(view) |
|
|
|
def wrapped_view(**kwargs): |
|
|
|
def wrapped_view(*args, **kwargs): |
|
|
|
if g.user is None: |
|
|
|
if g.user is None: |
|
|
|
return redirect(url_for('auth.login')) |
|
|
|
return redirect(url_for('auth.login')) |
|
|
|
|
|
|
|
|
|
|
|
return view(**kwargs) |
|
|
|
return view(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
return wrapped_view |
|
|
|
return wrapped_view |
|
|
|
|
|
|
|
|
|
|
|