gleam-lang/gleam

Unable to provide alternative hexpm credentials for `gleam publish`

Open

#4,318 opened on Mar 9, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Rust (21,417 stars) (960 forks)batch import
good first issuehelp wanted

Description

If you have already authenticated and saved a local token for Gleam to interact with the hex api, it is impossible to provide alternative user/pass credentials when publishing a package.

Attempting to publish a package by setting HEXPM_USER and HEXPM_PASS variables results in the following error:

error: Failed to decrypt data

A problem was encountered decrypting data.
The error from the encryption library was:

    Decryption failed

Steps to reproduce:

  • Generate a local hex token for a hexpm account using gleam hex authenticate
  • Run HEXPM_USER=a_different_account HEXPM_PASS=****** gleam publish
  • Observe the error above.

Contributor guide