Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
ça marche normalement
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTheGeek committed Feb 1, 2024
1 parent c7ea2e7 commit 790d563
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def home():

@app.route('/login', methods=['GET', 'POST'])
def login():
api_url = app.config['URL_API']
return render_template('login.html', api_url=str(api_url))
return render_template('login.html')

@app.route('/admin', methods=['GET', 'POST'])
def admin():
Expand Down
7 changes: 1 addition & 6 deletions templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,14 @@ <h1 class="mb-0">OU</h1>
$('form').submit(function (e) {
e.preventDefault();

{% if config['URL_API'] %}
var config = {};
config.URL_API = String(config['URL_API']);
console.log(String({{ api_url }}));
{% endif %}
var formData = {
email: $('#email').val(),
password: $('#password').val()
};

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

0 comments on commit 790d563

Please sign in to comment.