         case HTTPoison.get(userinfo_url) do
             {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
               result = Poison.Parser.parse!(body)
-              IO.inspect result
+              Logger.info inspect(result)
               changeset = User.changeset(%User{}, %{"openid"=> result["openid"], "nickname"=> result["nickname"], 
                   "province"=> result["province"],
                    "country"=> result["country"],

            {:ok, %HTTPoison.Response{status_code: 404}} ->
              Logger.error "Not found :("
            {:error, %HTTPoison.Error{reason: reason}} ->
              Logger.error reason
        end    
      end            
    end 


    if is_nil(access_token) or is_nil(openid) do 
      
      Logger.info "access_token or openid is empty"
      if is_nil(code) do 
        code_url = "#{code_url}?appid=#{appid}&redirect_uri=#{current_url}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect" 
        redirect conn |> halt, external: code_url
