From ce51d0b339bfcf08d0f72b83717f71d7d10ed78d Mon Sep 17 00:00:00 2001 From: Brais Moure Date: Thu, 11 Nov 2021 22:48:06 +0100 Subject: [PATCH] =?UTF-8?q?La=20autenticaci=C3=B3n=20en=20el=20API=20de=20?= =?UTF-8?q?Twitch=20ahora=20se=20redirecciona=20a=20twitimer.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Twitimer.xcodeproj/project.pbxproj | 4 ++-- .../UseCases/Launch/Account/Account/AccountViewModel.swift | 2 +- Twitimer/Util/Constants.swift | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Twitimer.xcodeproj/project.pbxproj b/Twitimer.xcodeproj/project.pbxproj index 5ffe101..0e84b76 100644 --- a/Twitimer.xcodeproj/project.pbxproj +++ b/Twitimer.xcodeproj/project.pbxproj @@ -1116,7 +1116,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.2.2; + MARKETING_VERSION = 1.2.3; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1142,7 +1142,7 @@ "@executable_path/Frameworks", ); MACH_O_TYPE = mh_execute; - MARKETING_VERSION = 1.2.2; + MARKETING_VERSION = 1.2.3; PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/Twitimer/UseCases/Launch/Account/Account/AccountViewModel.swift b/Twitimer/UseCases/Launch/Account/Account/AccountViewModel.swift index 330bfa1..08a6bbc 100644 --- a/Twitimer/UseCases/Launch/Account/Account/AccountViewModel.swift +++ b/Twitimer/UseCases/Launch/Account/Account/AccountViewModel.swift @@ -53,7 +53,7 @@ final class AccountViewModel: ObservableObject { func selected(url: URL) { - if url.host?.contains("localhost") ?? false { + if url.host?.contains(Constants.kTwitchRedirectHost) ?? false { let components = URLComponents(url: url, resolvingAgainstBaseURL: true) let authCodeItem = components?.queryItems?.first(where: { (item) -> Bool in diff --git a/Twitimer/Util/Constants.swift b/Twitimer/Util/Constants.swift index c4f0825..21314ec 100644 --- a/Twitimer/Util/Constants.swift +++ b/Twitimer/Util/Constants.swift @@ -13,7 +13,8 @@ struct Constants { static let kTwitchAuthUri = "https://id.twitch.tv/oauth2/" static let kTwitchAPIUri = "https://api.twitch.tv/helix/" static let kTwitchProfileUri = "https://www.twitch.tv/" - static let kTwitchRedirectUri = "http://localhost" + static let kTwitchRedirectUri = "https://twitimer.com" + static let kTwitchRedirectHost = "twitimer.com" // Remote static let kRemoteTwitchClientID = "TwitchClientID"