Protected form registration and authorization with js and backend validation