Skip to content

Gitea npm repo: Incorrect or missing password #32048

@FrostKiwi

Description

@FrostKiwi

Description

We have Gitea hosted on a subpath: domain.com/git
I tried to setup npm package hosting following https://docs.gitea.com/usage/packages/npm . I generated a token for a public user via curl -k -H "Content-Type: application/json" -d '{"name":"npm"}' -u user:password https://domain.com/git/api/v1/users/<user>/tokens
Got a SHA1 token.

I setup my npmrc:

@<scope>:registry=https://domain.com/git/api/packages/<user>/npm/
//domain.com/git/api/packages/<user>/npm/:_authToken=<SHA1 token>
strict-ssl=false

I publish a package

npm notice
npm notice Publishing to https://domain.com/git/api/packages/<user>/npm/ with tag latest and default access
npm error code E401
npm error Incorrect or missing password.
npm error If you were trying to login, change your password, create an
npm error authentication token or enable two-factor authentication then
npm error that means you likely typed your password in incorrectly.
npm error Please try again, or recover your password at:
npm error   https://www.npmjs.com/forgot
npm error
npm error If you were doing some other operation then your saved credentials are
npm error probably out of date. To correct this please try logging in again with:
npm error   npm login
npm error A complete log of this run can be found in: C:\Users\<user>\AppData\Local\npm-cache\_logs\2024-09-16T08_57_19_988Z-debug-0.log

npm version 10.8.1

Having followed the steps, but getting bumped for incorrect login. Is there a regression regarding npm and gitea? Did I do something wrong?

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary install, Linux Server, forward proxy through nginx

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detailtopic/packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions