jackwener / jackwener/OpenCLI

auth refresh: add cookie expiry diagnostics for refreshed status

Open
#1,882 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29.5k
Forks
2.9k
Avg merge
15h 36m
Merged PRs (30d)
70

Description

## Context
PR #1881 added `opencli auth refresh` with best-effort `touched` status and optional adapter refresh hooks.

Today `refreshed` is effectively unreachable unless a future site-specific refresh hook returns it. We need generic/adapter-level diagnostics that can compare safe cookie expiry metadata without exposing cookie values.

## Goal
Make `refreshed` meaningful when refresh visibly extends session expiry.

## Requirements
- Never output cookie/token/session values.
- Only expose safe timestamps/metadata such as `cookie_expiry_before` / `cookie_expiry_after` when available.
- Preserve `touched` as best-effort success when expiry is opaque or unchanged.
- Keep `not_logged_in` / `error` from updating `last_touched_at`.
- Prefer adapter hooks where generic cookie expiry is not reliable.

## Validation
- Unit tests for `refreshed` vs `touched` classification.
- Real-site spot check with @opencli-user when implemented.

Follow-up from PR #1881 / thread #OpenCLI:7bbdfcd2.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the `opencli auth refresh` entry point and the changes from PR #1881, then review the adapter refresh hooks and the thread referenced in the issue. Add unit tests covering `refreshed` versus `touched`, while ensuring only safe expiry metadata is exposed and `not_logged_in` or `error` do not update `last_touched_at`. Validate with the requested real-site spot check when implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.