Авторизация

+ интеграция с другими запросами
This commit is contained in:
Anton Kamalov
2024-10-22 01:29:32 +03:00
parent 339a55f8da
commit d1f513e106
7 changed files with 75 additions and 7 deletions

11
App/checker.py Normal file
View 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