mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix: Protect codersdk.Client SessionToken so it can be updated (#4965)
This feature is used by the coder agent to exchange a new token. By protecting the SessionToken via mutex we ensure there are no data races when accessing it.
This commit is contained in:
committed by
GitHub
parent
8cadb33396
commit
26ab0d37c1
@@ -43,7 +43,7 @@ func NewWithSubcommands(
|
||||
|
||||
// SetupConfig applies the URL and SessionToken of the client to the config.
|
||||
func SetupConfig(t *testing.T, client *codersdk.Client, root config.Root) {
|
||||
err := root.Session().Write(client.SessionToken)
|
||||
err := root.Session().Write(client.SessionToken())
|
||||
require.NoError(t, err)
|
||||
err = root.URL().Write(client.URL.String())
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user