Finally made progress on the two-factor thing. I hate JS