Event-CRUD-Flask-python3-API/middlewares/errorHandlers.py
2024-01-07 16:30:55 +02:00

11 lines
No EOL
324 B
Python

from functools import wraps
from flask import request, jsonify
def handle_auth_error(e):
return jsonify({"error": "Please login"}), 401
def handle_invalid_token(e):
return jsonify({"error": "Invalid session token"}), 401
def handle_invalid_header_error(e):
return jsonify({"error": "Please login again"}), 401