Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[expo-cli] Auto-login when envvars are defined (#3127)
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric authored Jan 26, 2021
1 parent 95ac89c commit d226657
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/expo-cli/src/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export type SecondFactorDevice = {
export async function loginOrRegisterAsync(): Promise<User> {
log.warn('An Expo user account is required to proceed.');

// Always try to auto-login when these variables are set, even in non-interactive mode
if (process.env.EXPO_CLI_USERNAME && process.env.EXPO_CLI_PASSWORD) {
return login({
username: process.env.EXPO_CLI_USERNAME,
password: process.env.EXPO_CLI_PASSWORD,
});
}

if (program.nonInteractive) {
throw new CommandError(
'NOT_LOGGED_IN',
Expand Down

0 comments on commit d226657

Please sign in to comment.