Fix #158. Check if req.session.profile exists first during auth.