Skip to content

Commit 0035b6c

Browse files
committed
add jwt token back to wsl connections
1 parent 4035974 commit 0035b6c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/shellexec/shellexec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ func StartWslShellProc(ctx context.Context, termSize waveobj.TermSize, cmdStr st
262262
conn.Debugf(ctx, "packed swaptoken %s\n", packedToken)
263263
cmdCombined = fmt.Sprintf(`%s=%s %s`, wavebase.WaveSwapTokenVarName, packedToken, cmdCombined)
264264
}
265+
jwtToken := cmdOpts.SwapToken.Env[wavebase.WaveJwtTokenVarName]
266+
if jwtToken != "" {
267+
cmdCombined = fmt.Sprintf(`%s=%s %s`, wavebase.WaveJwtTokenVarName, jwtToken, cmdCombined)
268+
}
265269
log.Printf("full combined command: %s", cmdCombined)
266270
ecmd := exec.Command("wsl.exe", "~", "-d", client.Name(), "--", "sh", "-c", cmdCombined)
267271
if termSize.Rows == 0 || termSize.Cols == 0 {

pkg/util/shellutil/tokenswap.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type TokenSwapEntry struct {
2020
Token string `json:"token"`
2121
SockName string `json:"sockname,omitempty"`
2222
RpcContext *wshrpc.RpcContext `json:"rpccontext,omitempty"`
23-
JwtToken string `json:"jwttoken,omitempty"`
2423
Env map[string]string `json:"env,omitempty"`
2524
ScriptText string `json:"scripttext,omitempty"`
2625
Exp time.Time `json:"-"`

0 commit comments

Comments
 (0)