Re-implemented secure login