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

Can not login from cli (expo publish) with env keys. #3119

Closed
wclr opened this issue Jan 24, 2021 · 4 comments · Fixed by #3127
Closed

Can not login from cli (expo publish) with env keys. #3119

wclr opened this issue Jan 24, 2021 · 4 comments · Fixed by #3127
Assignees
Labels
bug Something isn't working

Comments

@wclr
Copy link

wclr commented Jan 24, 2021

Description

Can not log in from cli (expo publish) with env variables set. It seems to me that it worked when using sdk 38 passing EXPO_USERNAME and EXPO_PASSWORD worked for automatic login.

After upgrade it doesn't. I also tried EXPO_CLI_USERNAME and EXPO_CLI_PASSWORD it doesn't work.

Environment

Expo CLI 4.0.17 environment info:
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - C:\Users\alexo\AppData\Roaming\npm\yarn.CMD
npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6953283
Expo Workflow: managed

Expected Behavior

expo publish (if expo is looged manuualy using expo login) doesn't request manual entrance of credentials.

Observed Behavior

expo publish requests manual entrance of credentials if not logged in previously.

@wclr wclr added the bug Something isn't working label Jan 24, 2021
@byCedric
Copy link
Member

Hi @wclr, thanks for writing in. The EXPO_CLI_USERNAME and EXPO_CLI_PASSWORD are the correct ones, but you could also try using an access token with EXPO_TOKEN.

I see that you are working from a Windows environment, how do you define these environment variables?

@wclr
Copy link
Author

wclr commented Jan 25, 2021

I see that you are working from a Windows environment, how do you define these environment variables?

In this case i'm running with child_process.execSync, code looks like this:

  const cmd = ['expo publish', dir, ...configArgs].join(' ')
  exec.sync(cmd, {
    env: {
      EXPO_CLI_USERNAME: username,
      EXPO_CLI_PASSWORD: password,
    },
  })

It seemed to work some time ago (a few months, when I last run this code) but with EXPO_USERNAME and EXPO_PASSWORD. After an update to the latest CLI it stopped.

@brentvatne
Copy link
Member

confirmed that i'm having this issue as well. that said, EXPO_TOKEN works great and is a better approach than using your username and password in this context. you can create a token here: https://expo.io/settings/access-tokens

@brentvatne
Copy link
Member

fix deployed in latest expo-cli

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants