Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change session url to fetch itCtx value. #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function Connect(username, password, options) {
baseURL : "https://itunesconnect.apple.com",
apiURL : "https://reportingitc2.apple.com/api/",
loginURL : "https://idmsa.apple.com/appleauth/auth/signin",
sessionURL : "https://olympus.itunes.apple.com/v1/session",
appleWidgetKey : "22d448248055bab0dc197c6271d738c3",
concurrentRequests : 2,
errorCallback : function(e) {},
Expand Down Expand Up @@ -297,7 +298,7 @@ Connect.prototype.login = function(username, password) {
//Request itunes connect page that will give us itCtx cookie needed for api requests
request.get({
//not sure where this action comes from, so it's hardcoded
url : self.options.baseURL + "/WebObjects/iTunesConnect.woa",
url : self.options.sessionURL,
followRedirect : false, //We can't follow redirects, otherwise we will "miss" the itCtx cookie
headers : {
'Cookie': myAccount[0]
Expand Down Expand Up @@ -962,4 +963,4 @@ TransformValue.toMomentObject = function(date) {
else {
throw new Error('Unknown date format. Please use Date() object or String() with format YYYY-MM-DD.');
}
}
}