AJAX 400 error only when 1st attempt creds fails

Hi, I need a little bit of guidance with CSRF and AJAX login. I’m using Polymer and is trying to achieve a single-page-like application and gather data using Polymer’s iron-ajax solution. Everything works well when I input the username and password for the first time correctly but it shoots an error 400 when I entered invalid creds first then enter the correct one. ANY HELP ANYONE PLEASE Y_Y THANKS!