clauddy 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/auth.js +7 -1
  2. package/package.json +1 -1
package/auth.js CHANGED
@@ -124,7 +124,13 @@ async function refresh() {
124
124
  client_id: CLIENT_ID,
125
125
  }),
126
126
  })
127
- if (!res.ok) throw Object.assign(new Error('refresh failed'), { status: res.status })
127
+ if (!res.ok) {
128
+ // a rejected grant (expired/revoked refresh token) means the session is
129
+ // dead — surface it as 401 so callers clear the token and prompt login.
130
+ // transient failures (429, 5xx) keep their status so we retry, not logout.
131
+ const dead = res.status === 400 || res.status === 403
132
+ throw Object.assign(new Error('refresh failed'), { status: dead ? 401 : res.status })
133
+ }
128
134
  const j = await res.json()
129
135
  save({
130
136
  access_token: j.access_token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clauddy",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "A cute desktop pet that tracks your Claude Code usage",
5
5
  "main": "main.js",
6
6
  "bin": {