Allows period (.) in new toggle names

It did work before, but this stops an error appearing in the console. Makes the js valid if user is undefined (no auth).