set up automatic redirect when not authenticated