Skip to content

🐛 Bug Report: Can't enable TOTP #817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MihkelMK opened this issue Apr 14, 2025 · 0 comments
Open

🐛 Bug Report: Can't enable TOTP #817

MihkelMK opened this issue Apr 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@MihkelMK
Copy link

👟 Reproduction steps

Create a docker-compose file with the following content:

services:
  service:
    image: stonith404/pingvin-share
    container_name: pingvin-share
    restart: unless-stopped
    ports:
      - 8000:3000
    volumes:
      - "/path/to/place/pingvin/data:/opt/app/backend/data"
      - "/path/to/place/pingvin/images:/opt/app/frontend/public/img"
    environment:
      - TRUST_PROXY=true

Start the app, create an account and go to /account to enable the TOTP.
Insert the current password, scan the QR code that pops up in a TOTP client.
Insert the code generated by the TOTP client.

👍 Expected behavior

TOTP gets added to the account and the popup closes.

👎 Actual Behavior

The code is invalid.
Image

Image

📜 Logs

pingvin-share  | Creating user and group...
pingvin-share  | Starting Caddy...
pingvin-share  | {"level":"info","ts":1744652988.2387083,"msg":"using config from file","file":"/opt/app/reverse-proxy/Caddyfile.trust-proxy"}
pingvin-share  | {"level":"info","ts":1744652988.2397432,"msg":"adapted config to JSON","adapter":"caddyfile"}
pingvin-share  | {"level":"info","ts":1744652988.2404282,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
pingvin-share  | {"level":"info","ts":1744652988.240788,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
pingvin-share  | {"level":"info","ts":1744652988.241027,"msg":"autosaved config (load with --resume flag)","file":"/home/pingvin-share/.config/caddy/autosave.json"}
pingvin-share  | {"level":"info","ts":1744652988.2410612,"msg":"serving initial configuration"}
pingvin-share  | Successfully started Caddy (pid=42) - Caddy is running in the background
pingvin-share  | {"level":"info","ts":1744652988.2431386,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/home/pingvin-share/.local/share/caddy"}
pingvin-share  | {"level":"info","ts":1744652988.2434092,"logger":"tls","msg":"finished cleaning storage units"}
pingvin-share  | {"level":"info","ts":1744652988.2435594,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000157200"}
pingvin-share  |   ▲ Next.js 14.2.26
pingvin-share  |   - Local:        http://localhost:3333
pingvin-share  |   - Network:      http://0.0.0.0:3333
pingvin-share  | 
pingvin-share  |  ✓ Starting...
pingvin-share  | 
pingvin-share  | > [email protected] prod
pingvin-share  | > prisma migrate deploy && prisma db seed && node dist/src/main
pingvin-share  | 
pingvin-share  |  ✓ Ready in 650ms
pingvin-share  | Environment variables loaded from prisma/.env
pingvin-share  | Prisma schema loaded from prisma/schema.prisma
pingvin-share  | Datasource "db": SQLite database "pingvin-share.db" at "file:../data/pingvin-share.db"
pingvin-share  | 
pingvin-share  | 24 migrations found in prisma/migrations
pingvin-share  | 
pingvin-share  | 
pingvin-share  | No pending migrations to apply.
pingvin-share  | Environment variables loaded from prisma/.env
pingvin-share  | Running seed command `ts-node prisma/seed/config.seed.ts` ...
pingvin-share  | 
pingvin-share  | 🌱  The seed command has been executed.
pingvin-share  | ┌─────────────────────────────────────────────────────────┐
pingvin-share  | │  Update available 6.4.1 -> 6.6.0                        │
pingvin-share  | │  Run the following to update                            │
pingvin-share  | │    npm i --save-dev prisma@latest                       │
pingvin-share  | │    npm i @prisma/client@latest                          │
pingvin-share  | └─────────────────────────────────────────────────────────┘
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG Showing log, warn, error, fatal messages
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [NestFactory] Starting Nest application... +5ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] PrismaModule dependencies initialized +59ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] JwtModule dependencies initialized +5ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] JwtModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ThrottlerModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] CacheModule dependencies initialized +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] AppModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [PrismaService] Connected to the database
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] EmailModule dependencies initialized +9ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ClamScanModule dependencies initialized +2ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] JobsModule dependencies initialized +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ReverseShareModule dependencies initialized +2ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] FileModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] UserModule dependencies initialized +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] OAuthModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] AuthModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [InstanceLoader] ShareModule dependencies initialized +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] AppController {/api}: +21ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/health, GET} route +6ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] AuthController {/api/auth}: +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/signUp, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/signIn, POST} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/signIn/totp, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/resetPassword/:email, POST} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/resetPassword, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/password, PATCH} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/token, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/signOut, POST} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/totp/enable, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/totp/verify, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/auth/totp/disable, POST} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] OAuthController {/api/oauth}: +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/oauth/available, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/oauth/status, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/oauth/auth/:provider, GET} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/oauth/callback/:provider, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/oauth/unlink/:provider, POST} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] UserController {/api/users}: +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users/me, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users/me, PATCH} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users/me, DELETE} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users/:id, PATCH} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/users/:id, DELETE} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] FileController {/api/shares/:shareId/files}: +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:shareId/files, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:shareId/files/zip, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:shareId/files/:fileId, GET} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:shareId/files/:fileId, DELETE} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] ReverseShareController {/api/reverseShares}: +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/reverseShares, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/reverseShares/:reverseShareToken, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/reverseShares, GET} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/reverseShares/:reverseShareId, DELETE} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] ShareController {/api/shares}: +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/all, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id/from-owner, GET} route +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id/metaData, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id/complete, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id/complete, DELETE} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id, DELETE} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/isShareIdAvailable/:id, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/shares/:id/token, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RoutesResolver] ConfigController {/api/configs}: +1ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/configs, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/configs/admin/:category, GET} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/configs/admin, PATCH} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/configs/admin/testEmail, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [RouterExplorer] Mapped {/api/configs/admin/logo, POST} route +0ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [ConfigService] Config.yaml is not set. Falling back to UI configuration.
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [NestApplication] Nest application successfully started +19ms
pingvin-share  | [Nest] 59  - 04/14/2025, 5:49:53 PM     LOG [ClamScanService] ClamAV is not active

This is all the logs after I restarted the container, tried and failed to add an TOTP.

I mainly tried the Bitwarden to generate the TOTP, but also tried Ente Auth to try and isolate the issue. I tried both scanning the QR and by copying the TOTP code directly when adding to both clients.
I am running the service behind an additional Caddy instance and Cloudflare with proxying turned on.

This issue appeared after updating, but I can't pinpoint the exact time because I use it infrequently. At some point it did not let me log in again, saying my TOTP code is wrong. I then tried adding a code to a account that didn't previously have it and got the same error. As adding a code to a new user is easier to replicate it's what I detailed above.

@MihkelMK MihkelMK added the bug Something isn't working label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant