auth stage 1 messy but working