hackmdio / hackmdio/hackmd-cli

login problem

未关闭
#108 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
176
派生
13
平均合并
1 天 4 小时
30 天内合并 PR
5

描述

```
hackmd-cli login
Retrying request... attempt #1 after delay of 200ms
Retrying request... attempt #2 after delay of 400ms
Retrying request... attempt #3 after delay of 800ms
Login failed
Error: Please ensure your credentials are correct
```
from curl, token woking fine:

```
curl -v https://api.hackmd.io/v1/me \
-H "Authorization: Bearer $HMD_API_ACCESS_TOKEN"
```
```
> GET /v1/me HTTP/2
> Host: api.hackmd.io
> User-Agent: curl/8.18.0
> Accept: */*
> Authorization: Bearer 4.........................
>
* Request completely sent off
< HTTP/2 200
< date: Fri, 21 Aug 2026 23:13:40 GMT
< content-type: application/json; charset=utf-8
< content-length: 236
< content-language: dev
< set-cookie: locale=dev; path=/; expires=Sat, 21 Aug 2027 23:13:40 GMT
< x-hackmd-api-version: 1.0.0
< x-target-scope: user
< x-target-id: 8..............
< x-ratelimit-userlimit: 400
< x-ratelimit-userremaining: 400
< x-ratelimit-userreset: 1788220799999
< etag: W/"ec-hTX............."
<
* Connection #0 to host api.hackmd.io:443 left intact
{"id":"8.........","name":"A..........","email":"d............@g.................","userPath":"j2B-..................","photo":"https://www.gravatar.com/avatar/......?s=96","teams":[],"upgraded":false}
```

versions: 2.4.0, 2.5.0 and @hackmd/hackmd-cli/2.5.0-beta.20260527230745.bf73672 linux-x64 node-v22.22.1

How do I fix this?

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by running the `hackmd-cli login` entry point with the token that succeeds against `GET https://api.hackmd.io/v1/me` via curl, and compare the CLI request with that working request. Use the reported versions as reproduction targets; done means login succeeds with the same valid token instead of retrying and reporting invalid credentials.

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, typescript
领域
api, authentication, cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
需要澄清
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。