From b8849ccecdcad2ce40d568b476b705fe50c63b39 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 29 Apr 2024 11:24:10 +0200 Subject: [PATCH] wip #6882 @0:20 connexion --- resources/webflow/css/custom.css | 3 +++ resources/webflow/js/custom.js | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/resources/webflow/css/custom.css b/resources/webflow/css/custom.css index e69de29..8818ac3 100644 --- a/resources/webflow/css/custom.css +++ b/resources/webflow/css/custom.css @@ -0,0 +1,3 @@ +.errors-container p { + color: #CC0132; +} diff --git a/resources/webflow/js/custom.js b/resources/webflow/js/custom.js index b9ee901..397a0ca 100644 --- a/resources/webflow/js/custom.js +++ b/resources/webflow/js/custom.js @@ -2,4 +2,26 @@ $(function () { console.log($('meta[name="csrf-token"]')); $('#wf-form-login').attr('action', '/landing/login'); $("#wf-form-login").append(''); + + + $(document).on("submit", '#wf-form-login', function (e) { + e.preventDefault() + console.log(window.location.href+'/catalogue') + let formData = $(this).serialize() + var $this = this + $.ajax({ + url: '/fluidbook/login', + type: 'POST', + data: formData, + success: function(data) { + window.location.href = window.location.href+'catalogue' + }, + error: function(xhr, status, error) { + $(".errors-container").remove() + $(".error").removeClass("error") + $("#wf-form-login").addClass("error").prepend('

Une erreur est survenue. Verifiez vos identifiants.

') + } + }); + }); + }); -- 2.39.5