[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
committed by Magesh K
parent 7e232cafbe
commit 947b31881f
4 changed files with 501 additions and 40 deletions

View File

@@ -202,7 +202,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()
@@ -212,9 +212,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
{