Fix login script to send json payload