diff options
-rw-r--r-- | nfsw/auth.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nfsw/auth.py b/nfsw/auth.py index 1850f50..d540a9a 100644 --- a/nfsw/auth.py +++ b/nfsw/auth.py @@ -27,3 +27,14 @@ def login_required(view): return wrapped_view +def anon_only(view): + @functools.wraps(view) + def wrapped_view(**kwargs): + if g.user is not None: + return redirect(url_for('io')) + + return view(**kwargs) + + return wrapped_view + + |