fix: remove Keychain accessGroup — fixes auth reset and health data
- Remove kSecAttrAccessGroup from KeychainService (requires entitlement that keeps getting stripped by Xcode) - Basic Keychain works without accessGroup for the main app - Fix health credentials migration check — use KeychainService.load directly - Tokens now persist correctly between app launches Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,11 +39,12 @@ struct PulseApp: App {
|
||||
.environmentObject(authManager)
|
||||
.onAppear {
|
||||
APIService.shared.authManager = authManager
|
||||
// Migrate: set health API key in Keychain if not yet
|
||||
if authManager.healthApiKey.isEmpty {
|
||||
authManager.setHealthApiKey("health-cosmo-2026")
|
||||
// Ensure health credentials are in Keychain
|
||||
if KeychainService.load(key: KeychainService.healthApiKeyKey) == nil {
|
||||
KeychainService.save(key: KeychainService.healthApiKeyKey, value: "health-cosmo-2026")
|
||||
HealthAPIService.configureCredentials(email: "daniilklimov25@gmail.com", password: "cosmo-health-2026")
|
||||
}
|
||||
authManager.healthApiKey = KeychainService.load(key: KeychainService.healthApiKeyKey) ?? ""
|
||||
Self.scheduleHealthSync()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user