Fixes mistaken var name
Adds button type attribute to prevent premature form submission
Adds more auth handling