fix the problem discuss url
refactor to need_login function
refactor need_login to check_login