mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Refactor login_required and add auth blueprint
Moved the login_required logic to a new utils.py for reuse. Added a new auth blueprint and registered it in app.py. Updated user blueprint to use the shared login_required function.
This commit is contained in:
2
app.py
2
app.py
@@ -17,6 +17,7 @@ from application import db, app, login_manager
|
||||
from application.admin.routes import admin_bp
|
||||
from application.user.routes import user_bp
|
||||
from application.add_meal.routes import bp as add_meal_bp
|
||||
from application.auth.routes import bp as auth_bp
|
||||
from typing import Optional
|
||||
|
||||
# Config
|
||||
@@ -34,6 +35,7 @@ def load_user(user_id: int):
|
||||
app.register_blueprint(admin_bp)
|
||||
app.register_blueprint(user_bp)
|
||||
app.register_blueprint(add_meal_bp)
|
||||
app.register_blueprint(auth_bp)
|
||||
|
||||
|
||||
# Routes
|
||||
|
||||
Reference in New Issue
Block a user