Event-CRUD-Flask-python3-API/middelwares/errorHandlers.py

11 lines
324 B
Python
Raw Normal View History

2024-01-07 14:21:35 +00:00
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