Store correct credentials for FreshRSS
This commit is contained in:
parent
157bd57c5e
commit
16954393c0
@ -75,9 +75,12 @@ struct SettingsReaderAPIAccountView : View {
|
||||
self.busy = false
|
||||
|
||||
switch result {
|
||||
case .success(let authenticated):
|
||||
case .success(let validatedCredentials):
|
||||
|
||||
if (authenticated != nil) {
|
||||
guard let validatedCredentials = validatedCredentials else {
|
||||
self.error = "Invalid email/password combination."
|
||||
return
|
||||
}
|
||||
|
||||
var newAccount = false
|
||||
let workAccount: Account
|
||||
@ -96,7 +99,7 @@ struct SettingsReaderAPIAccountView : View {
|
||||
|
||||
workAccount.endpointURL = apiURL
|
||||
|
||||
try workAccount.storeCredentials(credentials)
|
||||
try workAccount.storeCredentials(validatedCredentials)
|
||||
|
||||
if newAccount {
|
||||
workAccount.refreshAll() { result in }
|
||||
@ -108,10 +111,6 @@ struct SettingsReaderAPIAccountView : View {
|
||||
self.error = "Keychain error while storing credentials."
|
||||
}
|
||||
|
||||
} else {
|
||||
self.error = "Invalid email/password combination."
|
||||
}
|
||||
|
||||
case .failure:
|
||||
self.error = "Network error. Try again later."
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user