Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

'View Full Page' Inspect Tool Gets Stuck In Login Loop

Aperta
#563 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript

Direzione di ricerca

Inizia da magnifier-tool/index.js e segui il suo ciclo di vita e le chiamate di autenticazione. Conferma che lo strumento View Full Page non entri più nel ciclo di accesso e rimanga incorporabile senza il contesto del progetto. Se affronti la pulizia opzionale, esamina components/simple-transcription/index.js:1146-1155 e Page-Viewer message-handler.js:55-57, quindi verifica che i token non disponibili vengano segnalati senza attivare l’accesso e che il codice morto fuorviante venga rimosso o documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

It gets stuck in a login loop when clicked. This issue is actually in the interfaces component.

Suggested Fix
In magnifier-tool/index.js: drop the attachAuthentication / onProjectReady / CheckPermissions calls. The magnifier needs no project context and no auth — it operates purely on the imageElem it's handed.

New lifecycle:

connectedCallback() {
    this.render()
    this.addEventListeners()
}

disconnectedCallback() {
    this.renderCleanup.run()
    this.cleanup.run()
}

This kills the loop at the source and also makes MagnifierTool safely embeddable in any context (the workspace toolbar, Page-Viewer, future tools).

Additional Optional Fixes
components/simple-transcription/index.js:1146-1155 — don't call TPEN.login() from a postMessage handler.

#sendIdTokenToTool(targetWindow = ...) {
    const idToken = TPEN.getAuthorization()
    if (!idToken) {
        TPEN.login()   // <-- this nukes the parent window
        return
    }
    ...
}

Replace with a postMessage reply telling the tool no token is available, and let the tool decide what to do. Otherwise any future tool iframe that sends REQUEST_TPEN_ID_TOKEN while the parent's token is expired will trigger the same kind of redirect loop.

#sendIdTokenToTool(targetWindow = ...) {
    const idToken = TPEN.getAuthorization()
    if (!idToken) {
        this.#postToTool({ type: 'TPEN_ID_TOKEN_UNAVAILABLE' }, targetWindow)
        return
    }
    ...
}
https://github.com/CenterForDigitalHumanities/Page-Viewer Minor Cleanup

message-handler.js:55-57 — Page-Viewer is set up to receive REQUEST_TPEN_ID_TOKEN (a parent→tool message it would never get) rather than send it. The case is harmless but misleading. Either delete the case entirely, or replace it with a comment that Page-Viewer never sends or receives that message.

Not a bug — just dead code that sent me down the wrong trail earlier.

Lingua principale
JavaScript
Stelle
2
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CenterForDigitalHumanities/TPEN-interfaces

Tutte le issue di CenterForDigitalHumanities/TPEN-interfaces

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.