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

[expo-cli] Auto-login when envvars are defined #3127

Merged
merged 1 commit into from
Jan 26, 2021
Merged
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
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