Skip to content

Commit 8f4e525

Browse files
author
Thomas Roovers
committed
Fixed bugs after RxSwift upgrade
1 parent fec761e commit 8f4e525

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Cobalt.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
C3B5C5D122A16796004331A9 /* LoggingOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B5C5D022A16796004331A9 /* LoggingOption.swift */; };
4040
DFDA21FF1D6741AE00683D7D /* Cobalt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFDA21F41D6741AD00683D7D /* Cobalt.framework */; };
4141
DFDA22041D6741AE00683D7D /* CobaltTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFDA22031D6741AE00683D7D /* CobaltTests.swift */; };
42+
E90155A126CA359D000610C2 /* AuthorizationCodeRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E90155A026CA359D000610C2 /* AuthorizationCodeRequest.swift */; };
4243
/* End PBXBuildFile section */
4344

4445
/* Begin PBXContainerItemProxy section */
@@ -82,6 +83,7 @@
8283
DFDA22031D6741AE00683D7D /* CobaltTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CobaltTests.swift; sourceTree = "<group>"; };
8384
DFDA22051D6741AE00683D7D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8485
DFDA22131D6741C200683D7D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
86+
E90155A026CA359D000610C2 /* AuthorizationCodeRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthorizationCodeRequest.swift; sourceTree = "<group>"; };
8587
/* End PBXFileReference section */
8688

8789
/* Begin PBXFrameworksBuildPhase section */
@@ -155,6 +157,7 @@
155157
C37900172181DD1F00926793 /* Authentication.swift */,
156158
C37900182181DD1F00926793 /* AccessToken.swift */,
157159
C37900192181DD1F00926793 /* AuthenticationProvider.swift */,
160+
E90155A026CA359D000610C2 /* AuthorizationCodeRequest.swift */,
158161
);
159162
path = Authentication;
160163
sourceTree = "<group>";
@@ -365,6 +368,7 @@
365368
C3B5C5D122A16796004331A9 /* LoggingOption.swift in Sources */,
366369
C316AFA5230FF5250036E295 /* String+Extension.swift in Sources */,
367370
C37900242181DD1F00926793 /* SwiftyJSON+Extension.swift in Sources */,
371+
E90155A126CA359D000610C2 /* AuthorizationCodeRequest.swift in Sources */,
368372
C37900282181DD1F00926793 /* Authentication.swift in Sources */,
369373
C37900262181DD1F00926793 /* Optional.swift in Sources */,
370374
C316AF9E230FF03C0036E295 /* Request+Cache.swift in Sources */,

Sources/Core/Authentication/AuthenticationProvider.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class AuthenticationProvider {
176176
self?.isAuthenticating = false
177177
return Single<Void>.just(())
178178

179-
}.catchError { [weak self, client] error -> Single<Void> in
179+
}.catch { [weak self, client] error -> Single<Void> in
180180
defer {
181181
self?.isAuthenticating = false
182182
}
@@ -203,7 +203,7 @@ class AuthenticationProvider {
203203

204204
guard let host = self.client.config.authentication.host,
205205
let clientId = self.client.config.authentication.clientID else {
206-
observer(.error(Error.invalidRequest("Missing 'host' and/or 'clientId'")))
206+
observer(.failure(Error.invalidRequest("Missing 'host' and/or 'clientId'")))
207207
return Disposables.create()
208208
}
209209

@@ -229,7 +229,7 @@ class AuthenticationProvider {
229229
print("authUrl: \(authURLString)")
230230

231231
guard let authURL = URL(string: authURLString) else {
232-
observer(.error(Error.invalidUrl))
232+
observer(.failure(Error.invalidUrl))
233233
return Disposables.create()
234234
}
235235

Sources/Core/Base/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ open class Client: ReactiveCompatible {
101101
/// - Returns: `Promise<JSON>`
102102
open func request(_ request: Request) -> Single<JSON> {
103103
// Strip slashes to form a valid urlString
104-
guard var host = (request.host ?? config.host) else {
104+
guard let host = (request.host ?? config.host) else {
105105
return Single<JSON>.error(Error.invalidRequest("Missing 'host'").set(request: request))
106106
}
107107

0 commit comments

Comments
 (0)