Websocket token is not refreshed after expiring #243

Closed
opened 2026-02-05 17:19:29 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Boy132 on GitHub (Jan 24, 2025).

The websocket token is only valid for 15 min. Wings sends an event when it's about the expire so you can generate a new token.
Which is what we already do but for some reason the re-auth doesn't work.

37f9725f27/resources/views/filament/components/server-console.blade.php (L152)

https://discord.com/channels/1218730176297439332/1328887232156930119

Originally created by @Boy132 on GitHub (Jan 24, 2025). The websocket token is only valid for 15 min. Wings sends an event when it's about the expire so you can generate a new token. Which is what we already do but for some reason the re-auth doesn't work. https://github.com/pelican-dev/panel/blob/37f9725f2727778165e00ce47d15e920571e6158/resources/views/filament/components/server-console.blade.php#L152 https://discord.com/channels/1218730176297439332/1328887232156930119
Author
Owner

@F9Alejandro commented on GitHub (Jan 25, 2025):

What about making the valid time shorter during testing this issue to see if the wings listener is properly registered for checking the validity of the jwt. This might give us some insight on what might be going on between the two. 37f9725f27/app/Http/Controllers/Api/Client/Servers/WebsocketController.php (L55-L56)

Ignore that. It looks to be an issue with the token var not being updated properly and pushes the old one instead.

First auth after reload:

{"event":"auth","args":["eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6ImI1ZDlkMjRmYTViNDNiZmNhMmU1MjRmMmZlM2ZiMzZjIn0.eyJpc3MiOiJodHRwczovL2Rldi5wYW5lbC52aWJlY2hlY2suY2MiLCJhdWQiOlsiaHR0cHM6Ly9kZXYubm9kZS52aWJlY2hlY2suY2M6ODA5MCJdLCJqdGkiOiJiNWQ5ZDI0ZmE1YjQzYmZjYTJlNTI0ZjJmZTNmYjM2YyIsImlhdCI6MTczNzc2NjEyMCwibmJmIjoxNzM3NzY1ODIwLCJleHAiOjE3Mzc3NjY3MjAsInNlcnZlcl91dWlkIjoiNDAwNDA2YzItM2I1Yy00ZDE4LTgyMTItZWYwYWE4ZWU2NWFmIiwicGVybWlzc2lvbnMiOlsiKiIsImFkbWluLndlYnNvY2tldC5lcnJvcnMiLCJhZG1pbi53ZWJzb2NrZXQuaW5zdGFsbCIsImFkbWluLndlYnNvY2tldC50cmFuc2ZlciJdLCJ1c2VyX3V1aWQiOiI4YTNjMTgxMC0yMjRiLTQzMTktODVjZi00NDgzM2M2ODcxZGMiLCJ1c2VyX2lkIjoxLCJ1bmlxdWVfaWQiOiJUTmRwN050MVlaYmJyck5aIn0.W5OoGUzt7HrO8uiz22oK7j_aWDBNVkhL_MOUi6o6LLM"]}

Image

Image

Expiring alert:

{"event":"auth","args":["eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6ImI1ZDlkMjRmYTViNDNiZmNhMmU1MjRmMmZlM2ZiMzZjIn0.eyJpc3MiOiJodHRwczovL2Rldi5wYW5lbC52aWJlY2hlY2suY2MiLCJhdWQiOlsiaHR0cHM6Ly9kZXYubm9kZS52aWJlY2hlY2suY2M6ODA5MCJdLCJqdGkiOiJiNWQ5ZDI0ZmE1YjQzYmZjYTJlNTI0ZjJmZTNmYjM2YyIsImlhdCI6MTczNzc2NjEyMCwibmJmIjoxNzM3NzY1ODIwLCJleHAiOjE3Mzc3NjY3MjAsInNlcnZlcl91dWlkIjoiNDAwNDA2YzItM2I1Yy00ZDE4LTgyMTItZWYwYWE4ZWU2NWFmIiwicGVybWlzc2lvbnMiOlsiKiIsImFkbWluLndlYnNvY2tldC5lcnJvcnMiLCJhZG1pbi53ZWJzb2NrZXQuaW5zdGFsbCIsImFkbWluLndlYnNvY2tldC50cmFuc2ZlciJdLCJ1c2VyX3V1aWQiOiI4YTNjMTgxMC0yMjRiLTQzMTktODVjZi00NDgzM2M2ODcxZGMiLCJ1c2VyX2lkIjoxLCJ1bmlxdWVfaWQiOiJnMlJDVkpJcTdaV1R1dEhxIn0.TpUyyo8sUh-4_xA4bxghAufjxFNHIhCoXs3fsewB2Uc"]}

Image

Image

@F9Alejandro commented on GitHub (Jan 25, 2025): ~~What about making the valid time shorter during testing this issue to see if the wings listener is properly registered for checking the validity of the jwt. This might give us some insight on what might be going on between the two. https://github.com/pelican-dev/panel/blob/37f9725f2727778165e00ce47d15e920571e6158/app/Http/Controllers/Api/Client/Servers/WebsocketController.php#L55-L56~~ Ignore that. It looks to be an issue with the token var not being updated properly and pushes the old one instead. First auth after reload: ```{"event":"auth","args":["eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6ImI1ZDlkMjRmYTViNDNiZmNhMmU1MjRmMmZlM2ZiMzZjIn0.eyJpc3MiOiJodHRwczovL2Rldi5wYW5lbC52aWJlY2hlY2suY2MiLCJhdWQiOlsiaHR0cHM6Ly9kZXYubm9kZS52aWJlY2hlY2suY2M6ODA5MCJdLCJqdGkiOiJiNWQ5ZDI0ZmE1YjQzYmZjYTJlNTI0ZjJmZTNmYjM2YyIsImlhdCI6MTczNzc2NjEyMCwibmJmIjoxNzM3NzY1ODIwLCJleHAiOjE3Mzc3NjY3MjAsInNlcnZlcl91dWlkIjoiNDAwNDA2YzItM2I1Yy00ZDE4LTgyMTItZWYwYWE4ZWU2NWFmIiwicGVybWlzc2lvbnMiOlsiKiIsImFkbWluLndlYnNvY2tldC5lcnJvcnMiLCJhZG1pbi53ZWJzb2NrZXQuaW5zdGFsbCIsImFkbWluLndlYnNvY2tldC50cmFuc2ZlciJdLCJ1c2VyX3V1aWQiOiI4YTNjMTgxMC0yMjRiLTQzMTktODVjZi00NDgzM2M2ODcxZGMiLCJ1c2VyX2lkIjoxLCJ1bmlxdWVfaWQiOiJUTmRwN050MVlaYmJyck5aIn0.W5OoGUzt7HrO8uiz22oK7j_aWDBNVkhL_MOUi6o6LLM"]}``` ![Image](https://github.com/user-attachments/assets/39bfad5c-8e34-4021-a005-97cd378b618e) ![Image](https://github.com/user-attachments/assets/c663d17b-5f15-4c7d-a244-a45d00c09d23) Expiring alert: ```{"event":"auth","args":["eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI6ImI1ZDlkMjRmYTViNDNiZmNhMmU1MjRmMmZlM2ZiMzZjIn0.eyJpc3MiOiJodHRwczovL2Rldi5wYW5lbC52aWJlY2hlY2suY2MiLCJhdWQiOlsiaHR0cHM6Ly9kZXYubm9kZS52aWJlY2hlY2suY2M6ODA5MCJdLCJqdGkiOiJiNWQ5ZDI0ZmE1YjQzYmZjYTJlNTI0ZjJmZTNmYjM2YyIsImlhdCI6MTczNzc2NjEyMCwibmJmIjoxNzM3NzY1ODIwLCJleHAiOjE3Mzc3NjY3MjAsInNlcnZlcl91dWlkIjoiNDAwNDA2YzItM2I1Yy00ZDE4LTgyMTItZWYwYWE4ZWU2NWFmIiwicGVybWlzc2lvbnMiOlsiKiIsImFkbWluLndlYnNvY2tldC5lcnJvcnMiLCJhZG1pbi53ZWJzb2NrZXQuaW5zdGFsbCIsImFkbWluLndlYnNvY2tldC50cmFuc2ZlciJdLCJ1c2VyX3V1aWQiOiI4YTNjMTgxMC0yMjRiLTQzMTktODVjZi00NDgzM2M2ODcxZGMiLCJ1c2VyX2lkIjoxLCJ1bmlxdWVfaWQiOiJnMlJDVkpJcTdaV1R1dEhxIn0.TpUyyo8sUh-4_xA4bxghAufjxFNHIhCoXs3fsewB2Uc"]}``` ![Image](https://github.com/user-attachments/assets/f441b042-95b1-495b-96ee-847a90697e9f) ![Image](https://github.com/user-attachments/assets/fd248a41-4b6a-4990-bafb-dc5d84808a7f)
Author
Owner

@F9Alejandro commented on GitHub (Jan 25, 2025):

https://github.com/pelican-dev/panel/pull/944 has a potential fix. Open to suggestions.

@F9Alejandro commented on GitHub (Jan 25, 2025): https://github.com/pelican-dev/panel/pull/944 has a potential fix. Open to suggestions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel-pelican-dev#243