tolgee / tolgee-cli

The Tolgee CLI
MIT License
16 stars 11 forks source link

CLI is unable to authenticate when using apiUrl #103

Open wfjsw opened 3 months ago

wfjsw commented 3 months ago

Starting from some recent CLI version, using npx @tolgee/cli pull was not sufficient to authenticate to the self-hosted server when apiUrl is present in .tolgeerc.yaml.

...
projectId: 20
apiUrl: "https://server"
format: JSON_TOLGEE
...
> npx @tolgee/cli pull
Need to install the following packages:
@tolgee/cli@2.1.6
Ok to proceed? (y) y

🔴 No API key has been provided. You must either provide one via --api-key, or login via `tolgee login`.

Instead, I must do npx @tolgee/cli --api-url https://server pull

> npx @tolgee/cli --api-url https://server pull
🐭✅     Fetching strings from Tolgee...
🐭✅     Extracting strings...
✅ Done!
stepan662 commented 2 months ago

Hey, sorry for late reaction. And you are using env variable, or login command? I've tested the apiUrl in the config and I haven't found any issues with that.

wfjsw commented 2 months ago

I did logged in with command and it requires apiurl arg at that time. Let me try once again later...

wfjsw commented 2 months ago

Hmm tried once again with npx @tolgee/cli login without --api-url and now it works. Dunno what's the deal with the undefined thing.

> npx @tolgee/cli login xxxxx
 ✅ Logged in as *** on undefined. Welcome back!
> npx @tolgee/cli pull
 🐭✅     Fetching strings from Tolgee...
 🐭✅     Extracting strings...
 ✅ Done!
wfjsw commented 2 months ago

Looking at the authentcation file it is stored in a separated entry than that stored with --api-url. Is this expected?

stepan662 commented 1 month ago

I'll need to check the login functionality, it seems like it's not very intuitive.