Skip to content

Commit

Permalink
fix: disable interactive browser login when running in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Jun 2, 2022
1 parent e8d5009 commit 8a05819
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { chooseProjectName, chooseStaticSite, wouldYouLikeToCreateStaticSite, wo
import { swaCliPersistencePlugin } from "./swa-cli-persistence-plugin";
import { SWACLIPersistenceCachePlugin } from "./swa-cli-persistence-plugin/persistence-cache-plugin";
import { dasherize, logger } from "./utils";
import { isRunningInDocker } from "./utils/docker";

const DEFAULT_AZURE_LOCATION = "West US 2";

Expand Down Expand Up @@ -61,7 +62,8 @@ export async function authenticateWithAzureIdentity(details: LoginDetails = {},

const environmentCredential = new EnvironmentCredential();

const credentials = [environmentCredential, browserCredential, deviceCredential];
// Only use interactive browser credential if we're not running in docker
const credentials = isRunningInDocker() ? [environmentCredential, deviceCredential] : [environmentCredential, browserCredential, deviceCredential];

if (details.tenantId && details.clientId && details.clientSecret) {
const clientSecretCredential = new ClientSecretCredential(details.tenantId, details.clientId, details.clientSecret, {
Expand Down

0 comments on commit 8a05819

Please sign in to comment.