if current_user.is_logged_in:
    return
try:
    if _is_public(current_app.view_functions[request.endpoint]):
        return
except KeyError:
    abort(404)
logging.info('No current user and %s is not public' % request.path[1:])
return redirect(url_for('some_public_page'))
Создайте декоратор общедоступных URL-адресов Flask