Авторизация
+ интеграция с другими запросами
This commit is contained in:
11
App/checker.py
Normal file
11
App/checker.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from flask import render_template, redirect, url_for, session, request
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def check_auth(func):
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
if 'user_id' not in session:
|
||||
return redirect(url_for('auth_bp.auth'))
|
||||
return func(*args, **kwargs)
|
||||
return wrapper
|
||||
Reference in New Issue
Block a user