Fixed authentification methods in JS