Skip to content

tokenHelper documentation unclear #847

Description

@schmod

The current documentation for the tokenHelper setting describes it as such:

A token helper is an executable which outputs an auth token. This can be used in situations where the authToken is not a constant value but is something that refreshes regularly, where a script or other tool can use an existing refresh token to obtain a new access token.

This is not a completely accurate description, as pnpm expects a tokenHelper script to output the full value of the Authorization header, ie. Bearer MY_TOKEN, rather than just a token by itself.

This is distinct from the _authToken setting, which only expects the value of the token itself (MY_TOKEN from the previous example).

Given that the two settings are documented using similar language, it's probably worth calling out the slightly-different behaviors.

Notably, if you fall into this trap (as I did), it's rather confusing/difficult to debug – PNPM (quite sensibly) scrubs Authorization header values from logging/errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions