Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion lib/commands/appstore-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export class PublishIOS implements ICommand {
const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
applicationSpecificPassword: this.$options.appleApplicationSpecificPassword,
sessionBase64: this.$options.appleSessionBase64,
requireInteractiveConsole: true
requireInteractiveConsole: true,
requireApplicationSpecificPassword: true
});
if (!user.areCredentialsValid) {
this.$errors.failWithoutHelp(`Invalid username and password combination. Used '${username}' as the username.`);
Expand Down
3 changes: 2 additions & 1 deletion lib/services/apple-portal/apple-portal-session-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export class ApplePortalSessionService implements IApplePortalSessionService {
const statusCode = err && err.response && err.response.statusCode;
result.areCredentialsValid = statusCode !== 401 && statusCode !== 403;
result.isTwoFactorAuthenticationEnabled = statusCode === 409;
if (result.isTwoFactorAuthenticationEnabled && opts && !opts.applicationSpecificPassword) {

if (result.isTwoFactorAuthenticationEnabled && opts && opts.requireApplicationSpecificPassword && !opts.applicationSpecificPassword) {
this.$errors.failWithoutHelp(`Your account has two-factor authentication enabled but --appleApplicationSpecificPassword option is not provided.
To generate an application-specific password, please go to https://appleid.apple.com/account/manage.
This password will be used for the iTunes Transporter, which is used to upload your application.`);
Expand Down
1 change: 1 addition & 0 deletions lib/services/apple-portal/definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface IAppleCreateUserSessionOptions {
applicationSpecificPassword?: string;
sessionBase64: string;
requireInteractiveConsole?: boolean;
requireApplicationSpecificPassword?: boolean;
}

interface IAppleLoginResult {
Expand Down