@@ -104,7 +104,7 @@ func Create(ctx context.Context, template string, opts ...SandboxOption) (*Sandb
104104 return nil , fmt .Errorf ("failed to create sandbox: %w" , err )
105105 }
106106
107- sb := newSandbox (config , api , resp .SandboxID , resp .TemplateID , resp .EnvdVersion )
107+ sb := newSandbox (config , api , resp .SandboxID , resp .EnvdAccessToken , resp . TemplateID , resp .EnvdVersion )
108108 return sb , nil
109109}
110110
@@ -125,7 +125,7 @@ func Connect(ctx context.Context, sandboxID string, opts ...SandboxOption) (*San
125125 return nil , fmt .Errorf ("failed to connect to sandbox: %w" , err )
126126 }
127127
128- sb := newSandbox (config , api , resp .GetSandboxID (), resp .GetTemplateID (), resp .GetEnvdVersion ())
128+ sb := newSandbox (config , api , resp .GetSandboxID (), resp .GetEnvdAccessToken (), resp . GetTemplateID (), resp .GetEnvdVersion ())
129129 return sb , nil
130130}
131131
@@ -139,7 +139,8 @@ func applySandboxOptions(opts []SandboxOption) *sandboxOptions {
139139}
140140
141141// newSandbox initializes a Sandbox with an envd client and management API.
142- func newSandbox (config * ConnectionConfig , api * SandboxApi , sandboxID , templateID , envdVersion string ) * Sandbox {
142+ func newSandbox (config * ConnectionConfig , api * SandboxApi , sandboxID , EnvdAccessToken , templateID , envdVersion string ) * Sandbox {
143+ config .AccessToken = EnvdAccessToken
143144 client := runtime .NewWithConfig (sandboxID , config .toEnvdConfig (sandboxID ))
144145
145146 return & Sandbox {
0 commit comments