Widget: fetch signed-in visitor tokens when a session is requested

Geschlossen
#461 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Saifjafri212213 arbeitet bereits daran.

Seit 30.10.2026.

  • #476 von @Saifjafri212213 — gemerged

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
63/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
api, authentication

Rechercherichtung

Start by locating the widget’s /session request and the existing userToken option, then read the nearby tests and configuration docs. Add an optional async provider while preserving static-token behavior, send the resolved token only to the configured ChatCops API, and keep signing secrets on the host server. Done means tests cover fresh tokens, provider failures, and static tokens, with the provider documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement
What problem would this solve?

The widget accepts userToken as a fixed string and sends it when requesting a session. A page can stay open for a long time before the visitor opens the chat, so a short-lived signed token may expire before the first /session request. The server correctly rejects expired identity tokens, but the host page currently has no way to provide a fresh one at that point.

What would you like to happen?

Add an optional async token provider (or equivalent callback) that the widget calls when it is about to request /session, so the host can return a current signed token. Keep the existing string userToken behavior backwards compatible, send the resolved token only to the configured ChatCops API, and document that signing secrets must remain on the host server. Add tests for fresh tokens, provider failures, and the existing static-token option.

Contributing
  • I'd like to work on this myself
Vorherrschende Sprache
TypeScript
Sterne
13
Forks
7
Ø Merge
3 Std. 10 Min.
Gemergte PRs (30 T.)
339

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codercops/chatcops

Alle Issues in codercops/chatcops

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.