from flask import _request_ctx_stack def get_authenticated_user(): return getattr(_request_ctx_stack.top, 'authenticated_user', None) def get_validated_token(): return getattr(_request_ctx_stack.top, 'validated_token', None)