[AltStoreCore] Caches Patreon session cookies from in-app browser

Allows us to download apps from locked Patreon posts.
This commit is contained in:
Riley Testut
2023-11-29 17:28:46 -06:00
parent 45da6b626f
commit 5cb283dc95
4 changed files with 501 additions and 40 deletions

View File

@@ -191,7 +191,7 @@ private extension PatreonViewController
@IBAction func authenticate(_ sender: UIBarButtonItem)
{
PatreonAPI.shared.authenticate { (result) in
PatreonAPI.shared.authenticate(presentingViewController: self) { (result) in
do
{
let account = try result.get()
@@ -201,9 +201,12 @@ private extension PatreonViewController
self.update()
}
}
catch ASWebAuthenticationSessionError.canceledLogin
catch is CancellationError
{
// Ignore
// Clear in-app browser cache in case they are signed into wrong account.
Task<Void, Never>.detached {
await PatreonAPI.shared.deleteAuthCookies()
}
}
catch
{