Refresh Token Handling

Nucleic-Session: F3D68A19-D251-48C6-AFAA-9BDC68FB88BC
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-09 04:25:18 -07:00
co-authored by nucleic
parent 117d76b60c
commit 3c8a81d21f
+30
View File
@@ -1688,6 +1688,36 @@ private struct ControlSettingsTab: View {
}
}
}
Picker("Authenticate Codex with", selection: $codexAuthMode) {
Text("ChatGPT subscription (OAuth)").tag(ControlAuthMode.oauth.rawValue)
Text("OpenAI API key").tag(ControlAuthMode.apiKey.rawValue)
}
.disabled(!containerServiceEnabled)
if codexAuthMode == ControlAuthMode.apiKey.rawValue {
SecureField("sk-…", text: $codexAPIKeyDraft)
.disabled(!containerServiceEnabled)
HStack(spacing: 10) {
Button("Save Key") {
if CodexControlAPIKeyStore.save(codexAPIKeyDraft) { codexKeySaved = CodexControlAPIKeyStore.hasKey }
codexAPIKeyDraft = ""
}
.disabled(!containerServiceEnabled
|| codexAPIKeyDraft.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
if codexKeySaved {
Button("Clear", role: .destructive) {
CodexControlAPIKeyStore.clear()
codexKeySaved = false
}
Label("Key saved", systemImage: "checkmark.seal.fill")
.foregroundStyle(.green).font(.caption)
}
}
} else {
Text("Reused from your host `~/.codex` login and kept in sync after each turn, so host and container no longer revoke each other's refresh token.")
.font(.caption).foregroundStyle(.secondary)
}
}
Section("Nucleic Control container") {