Skip to content

Commit 7d0a502

Browse files
committed
Avoid requests in recents without required token
Currently this results with a 401, and that humanizes to "token was rejected" but that is not quite right.
1 parent 7b1bcda commit 7d0a502

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
376376
settings.token(deploymentURL.toURL())?.first,
377377
)
378378

379+
if (client.token == null && settings.requireTokenAuth) {
380+
throw Exception("Unable to make request; token was not found in CLI config.")
381+
}
382+
379383
// Delete connections that have no workspace.
380384
val items = client.workspaces().flatMap { it.toAgentList() }
381385
connectionsByWorkspace.forEach { (name, connections) ->

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy