🐛 Bug Report: URL constructor: (Komga calback) is not a valid URL #248

Closed
opened 2025-07-08 08:43:30 -04:00 by AtHeartEngineer · 0 comments

Originally created by @vicerious001 on 4/16/2025

Reproduction steps

  1. Add client in Pocket ID using the callback URL as recommended in Komga's docs
  2. Configure Komga for social login as per above docs
  3. Attempt to log in to Komga via Pocket ID
  4. Pocket ID pop up appears, log in as normal
  5. Green checkmark appears in Pocket ID window, but the Sign In button is grey and the spinner just keeps going

Expected behavior

Sign in should complete, pop up close, and Komga should be logged in

Actual Behavior

The pop seems to hang, never completing. The "Sign In" button is grey and its spinner just keeps going.

Version and Environment

Browser: Firefox 137.0.2
Docker-installed Pocket ID version 0.47.0
Docker-installed Komga version 1.21.2
HAProxy as reverse-proxy

Pocket ID Compose.yml
---
services:
  pocket-id:
    image: ghcr.io/pocket-id/pocket-id
    restart: unless-stopped
    env_file: .env
    ports:
      - 127.0.0.1:4000:3000
      - 127.0.0.1:4001:8080
    volumes:
      - "./data:/app/backend/data"
    # Optional healthcheck  
    healthcheck:
      test: "curl -f http://localhost/health"
      interval: 1m30s
      timeout: 5s
      retries: 2
      start_period: 10s
    extra_hosts:
      - "comics.deb.internal:192.168.122.135"
Pocket ID .env
PUBLIC_APP_URL=https://auth.deb.internal
TRUST_PROXY=true
MAXMIND_LICENSE_KEY=
PUID=1000
PGID=1000
CADDY_DISABLED=true
Komga Compose.yml
---
services:
  komga:
    image: gotson/komga
    container_name: komga
    volumes:
      - ./komga:/config
      - /storage/comics:/storage/comics:ro
      - /etc/timezone:/etc/timezone:ro
    ports:
      - 127.0.0.1:25600:25600
    user: "1000:1000"
    environment:
      - JAVA_TOOL_OPTIONS=-Xmx2g
    restart: unless-stopped
Komga Config
---
komga:
  oauth2-account-creation: true
  oidc-email-verification: false
spring:
  security:
    oauth2:
      client:
        registration:
          pocketid:
            provider: pocketid
            client-id: [REDACTED]
            client-secret: [REDACTED]
            client-name: pocketid
            scope: openid,email
            authorization-grant-type: authorization_code
            redirect-uri: "{baseUrl}/{action}/oauth2/code/{registrationId}"
        provider:
          pocketid:
            user-name-attribute: sub
            authorization-uri: https://auth.deb.internal/authorize
            token-uri: https://auth.deb.internal/api/oidc/token
            jwk-set-uri: https://auth.deb.internal/.well-known/jwks.json
            user-info-uri: https://auth.deb.internal/api/oidc/userinfo
HAProxy Config pieces
frontend haproxy
    ...
        use_backend auth_api if { hdr(host) -i auth.deb.internal } { path_beg -i /api/ /.well-known/ }
        use_backend auth if { hdr(host) -i auth.deb.internal }

backend auth
        server pocket_id 127.0.0.1:4000

backend auth_api
        server pocket_id_api 127.0.0.1:4001

Log Output

The browser console outputs this in the Pocket ID pop up window:

Uncaught TypeError: URL constructor: : https://comics.deb.internal/login/oauth2/code/pocketid is not a valid URL.

No errors are logged server-side in either Pocket ID or Komga containers.

*Originally created by @vicerious001 on 4/16/2025* ### Reproduction steps 1. Add client in Pocket ID using the callback URL as recommended in [Komga's docs](https://komga.org/docs/installation/oauth2/) 2. Configure Komga for social login as per above docs 3. Attempt to log in to Komga via Pocket ID 4. Pocket ID pop up appears, log in as normal 5. Green checkmark appears in Pocket ID window, but the Sign In button is grey and the spinner just keeps going ### Expected behavior Sign in should complete, pop up close, and Komga should be logged in ### Actual Behavior The pop seems to hang, never completing. The "Sign In" button is grey and its spinner just keeps going. ### Version and Environment Browser: Firefox 137.0.2 Docker-installed Pocket ID version 0.47.0 Docker-installed Komga version 1.21.2 HAProxy as reverse-proxy <details><summary>Pocket ID Compose.yml</summary> ```yaml --- services: pocket-id: image: ghcr.io/pocket-id/pocket-id restart: unless-stopped env_file: .env ports: - 127.0.0.1:4000:3000 - 127.0.0.1:4001:8080 volumes: - "./data:/app/backend/data" # Optional healthcheck healthcheck: test: "curl -f http://localhost/health" interval: 1m30s timeout: 5s retries: 2 start_period: 10s extra_hosts: - "comics.deb.internal:192.168.122.135" ``` </details> <details><summary>Pocket ID .env</summary> ``` PUBLIC_APP_URL=https://auth.deb.internal TRUST_PROXY=true MAXMIND_LICENSE_KEY= PUID=1000 PGID=1000 CADDY_DISABLED=true ``` </details> <details><summary>Komga Compose.yml</summary> ```yaml --- services: komga: image: gotson/komga container_name: komga volumes: - ./komga:/config - /storage/comics:/storage/comics:ro - /etc/timezone:/etc/timezone:ro ports: - 127.0.0.1:25600:25600 user: "1000:1000" environment: - JAVA_TOOL_OPTIONS=-Xmx2g restart: unless-stopped ``` </details> <details><summary>Komga Config</summary> ```yaml --- komga: oauth2-account-creation: true oidc-email-verification: false spring: security: oauth2: client: registration: pocketid: provider: pocketid client-id: [REDACTED] client-secret: [REDACTED] client-name: pocketid scope: openid,email authorization-grant-type: authorization_code redirect-uri: "{baseUrl}/{action}/oauth2/code/{registrationId}" provider: pocketid: user-name-attribute: sub authorization-uri: https://auth.deb.internal/authorize token-uri: https://auth.deb.internal/api/oidc/token jwk-set-uri: https://auth.deb.internal/.well-known/jwks.json user-info-uri: https://auth.deb.internal/api/oidc/userinfo ``` </details> <details><summary>HAProxy Config pieces</summary> ``` frontend haproxy ... use_backend auth_api if { hdr(host) -i auth.deb.internal } { path_beg -i /api/ /.well-known/ } use_backend auth if { hdr(host) -i auth.deb.internal } backend auth server pocket_id 127.0.0.1:4000 backend auth_api server pocket_id_api 127.0.0.1:4001 ``` </details> ### Log Output The browser console outputs this in the Pocket ID pop up window: ``` Uncaught TypeError: URL constructor: : https://comics.deb.internal/login/oauth2/code/pocketid is not a valid URL. ``` No errors are logged server-side in either Pocket ID or Komga containers.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pocket-id#248