From 3237707d1384caa1acaa0b33a9bc42efbc954707 Mon Sep 17 00:00:00 2001 From: elouanjef Date: Thu, 1 Feb 2024 12:44:18 +0100 Subject: [PATCH] test login --- app.py | 2 +- templates/login.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index bda8e91..2968b8c 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ def home(): @app.route('/login', methods=['GET', 'POST']) def login(): - return render_template('login.html') + return render_template('login.html', app.config['URL_API']) @app.route('/admin', methods=['GET', 'POST']) def admin(): diff --git a/templates/login.html b/templates/login.html index 028c039..423c779 100644 --- a/templates/login.html +++ b/templates/login.html @@ -75,6 +75,7 @@

OU

}); $(document).ready(function () { + var URL_API = "{{ URL_API }}"; getUserProfile(); $('form').submit(function (e) { @@ -87,7 +88,7 @@

OU

$.ajax({ type: 'POST', - url: "https://api.insa-cvl.com/login", + url: URL_API + "/login", contentType: 'application/json;charset=UTF-8', data: JSON.stringify(formData), xhrFields: {