Skip to content

Commit 5ebd184

Browse files
author
Dimitar Tachev
authored
Merge pull request #4915 from NativeScript/fatme/fix-appstore-list
fix: fix appstore list command for accounts with 2fa
2 parents 56c8376 + 87f2b1f commit 5ebd184

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

lib/commands/appstore-upload.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export class PublishIOS implements ICommand {
4242
const user = await this.$applePortalSessionService.createUserSession({ username, password }, {
4343
applicationSpecificPassword: this.$options.appleApplicationSpecificPassword,
4444
sessionBase64: this.$options.appleSessionBase64,
45-
requireInteractiveConsole: true
45+
requireInteractiveConsole: true,
46+
requireApplicationSpecificPassword: true
4647
});
4748
if (!user.areCredentialsValid) {
4849
this.$errors.failWithoutHelp(`Invalid username and password combination. Used '${username}' as the username.`);

lib/services/apple-portal/apple-portal-session-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export class ApplePortalSessionService implements IApplePortalSessionService {
9696
const statusCode = err && err.response && err.response.statusCode;
9797
result.areCredentialsValid = statusCode !== 401 && statusCode !== 403;
9898
result.isTwoFactorAuthenticationEnabled = statusCode === 409;
99-
if (result.isTwoFactorAuthenticationEnabled && opts && !opts.applicationSpecificPassword) {
99+
100+
if (result.isTwoFactorAuthenticationEnabled && opts && opts.requireApplicationSpecificPassword && !opts.applicationSpecificPassword) {
100101
this.$errors.failWithoutHelp(`Your account has two-factor authentication enabled but --appleApplicationSpecificPassword option is not provided.
101102
To generate an application-specific password, please go to https://appleid.apple.com/account/manage.
102103
This password will be used for the iTunes Transporter, which is used to upload your application.`);

lib/services/apple-portal/definitions.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface IAppleCreateUserSessionOptions {
1919
applicationSpecificPassword?: string;
2020
sessionBase64: string;
2121
requireInteractiveConsole?: boolean;
22+
requireApplicationSpecificPassword?: boolean;
2223
}
2324

2425
interface IAppleLoginResult {

0 commit comments

Comments
 (0)