Не совсем понимаю как user_loader использовать если нет ID базы данных
new_users = [ {'new_username': 'admin1', 'new_code': 'pass1'}, {'new_username': 'admin2', 'new_code': 'pass2'}, {'new_username': 'admin3', 'new_code': 'pass3'} ] @app.route("/") @app.route("/login", methods=['POST', 'GET']) def login(): if current_user.is_authenticated: return redirect(url_for('booking')) form = LoginForm() if form.validate_on_submit(): new_user = [a for a in new_users if a["new_username"] == form.new_username.data and a["new_code"] == form.new_code.data] if new_user: login_user(new_user) next_page = request.args.get('next') return redirect(next_page) if next_page else redirect(url_for('login')) else: flash('Login Unsuccessful. Please check your name and the code', 'danger') return redirect(url_for('login')) return render_template('login.html', title='Login', form=form)