Add security check to auth front-end code