Ensures user is logged in before doing anything.