Skip to content

Commit 009b90e

Browse files
committed
Fix OAuth2ImplicitGrantWithQueryParams and add it to the project
1 parent 50d683c commit 009b90e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

OAuth2.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
879EE6F82CF61295008B3D74 /* OAuth2GrantTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 879EE6EC2CF61295008B3D74 /* OAuth2GrantTypes.swift */; };
4848
87B3E07C29F6AF240075C4DC /* OAuth2DeviceGrantTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87B3E07B29F6AF240075C4DC /* OAuth2DeviceGrantTests.swift */; };
4949
87FABDD32DC8D77000E0C67B /* XCTAssertThrowsErrorAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87FABDD22DC8D77000E0C67B /* XCTAssertThrowsErrorAsync.swift */; };
50+
87FABDD72DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87FABDD62DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift */; };
51+
87FABDD82DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87FABDD62DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift */; };
52+
87FABDD92DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87FABDD62DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift */; };
5053
CCCE40D6B4EAD9BF05C92ACE /* OAuth2CustomAuthorizer+iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCCE4C8DC3CB7713E59BC1EE /* OAuth2CustomAuthorizer+iOS.swift */; };
5154
DD0CCBAD1C4DC83A0044C4E3 /* OAuth2WebViewController+macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD0CCBAC1C4DC83A0044C4E3 /* OAuth2WebViewController+macOS.swift */; };
5255
EA9758181B222CEA007744B1 /* OAuth2PasswordGrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA9758171B222CEA007744B1 /* OAuth2PasswordGrant.swift */; };
@@ -189,6 +192,7 @@
189192
879EE6EE2CF61295008B3D74 /* OAuth2TokenTypeIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OAuth2TokenTypeIdentifiers.swift; sourceTree = "<group>"; };
190193
87B3E07B29F6AF240075C4DC /* OAuth2DeviceGrantTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OAuth2DeviceGrantTests.swift; sourceTree = "<group>"; };
191194
87FABDD22DC8D77000E0C67B /* XCTAssertThrowsErrorAsync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCTAssertThrowsErrorAsync.swift; sourceTree = "<group>"; };
195+
87FABDD62DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OAuth2ImplicitGrantWithQueryParams.swift; sourceTree = "<group>"; };
192196
CCCE4C8DC3CB7713E59BC1EE /* OAuth2CustomAuthorizer+iOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OAuth2CustomAuthorizer+iOS.swift"; sourceTree = "<group>"; };
193197
DD0CCBAC1C4DC83A0044C4E3 /* OAuth2WebViewController+macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OAuth2WebViewController+macOS.swift"; sourceTree = "<group>"; };
194198
EA9758171B222CEA007744B1 /* OAuth2PasswordGrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = OAuth2PasswordGrant.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
@@ -387,6 +391,7 @@
387391
8793811829D483EC00DC4EBC /* OAuth2DeviceGrant.swift */,
388392
EE507A371B1E15E000AE02E9 /* OAuth2DynReg.swift */,
389393
EE3174EB1945E83100210E62 /* OAuth2ImplicitGrant.swift */,
394+
87FABDD62DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift */,
390395
EA9758171B222CEA007744B1 /* OAuth2PasswordGrant.swift */,
391396
);
392397
path = Flows;
@@ -698,6 +703,7 @@
698703
659854571C5B3CA700237D39 /* OAuth2CodeGrantBasicAuth.swift in Sources */,
699704
659854531C5B3CA700237D39 /* OAuth2ImplicitGrant.swift in Sources */,
700705
659854501C5B3C9C00237D39 /* OAuth2Requestable.swift in Sources */,
706+
87FABDD82DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */,
701707
6598544F1C5B3C9C00237D39 /* OAuth2Base.swift in Sources */,
702708
8793811B29D483EC00DC4EBC /* OAuth2DeviceGrant.swift in Sources */,
703709
879EE6F62CF61295008B3D74 /* OAuth2ResponseTypes.swift in Sources */,
@@ -738,6 +744,7 @@
738744
EE86C4661C48F6AC00B7D486 /* OAuth2CodeGrantNoTokenType.swift in Sources */,
739745
EE9EBF1C1D775F74003263FC /* OAuth2Securable.swift in Sources */,
740746
EEF47D2C1B1E3FDD0057D838 /* OAuth2Requestable.swift in Sources */,
747+
87FABDD92DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */,
741748
EEC49F321C9BF22400989A18 /* OAuth2AuthRequest.swift in Sources */,
742749
8793811A29D483EC00DC4EBC /* OAuth2DeviceGrant.swift in Sources */,
743750
EE79F6551BFA93D900746243 /* OAuth2AuthConfig.swift in Sources */,
@@ -784,6 +791,7 @@
784791
8793811929D483EC00DC4EBC /* OAuth2DeviceGrant.swift in Sources */,
785792
879EE6F32CF61295008B3D74 /* OAuth2ResponseTypes.swift in Sources */,
786793
879EE6F42CF61295008B3D74 /* OAuth2TokenTypeIdentifiers.swift in Sources */,
794+
87FABDD72DC8FA8100E0C67B /* OAuth2ImplicitGrantWithQueryParams.swift in Sources */,
787795
879EE6F52CF61295008B3D74 /* OAuth2GrantTypes.swift in Sources */,
788796
EE79F6571BFA945C00746243 /* OAuth2ClientConfig.swift in Sources */,
789797
19C919DD1E51CC8000BFC834 /* OAuth2CustomAuthorizer+macOS.swift in Sources */,

Sources/Flows/OAuth2ImplicitGrantWithQueryParams.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import Base
3232
*/
3333
open class OAuth2ImplicitGrantWithQueryParams: OAuth2ImplicitGrant {
3434

35-
override open func handleRedirectURL(_ redirect: URL) {
35+
override open func handleRedirectURL(_ redirect: URL) async throws -> OAuth2JSON {
3636
logger?.debug("OAuth2", msg: "Handling redirect URL \(redirect.description)")
3737
do {
3838
// token should be in the URL query
@@ -45,9 +45,11 @@ open class OAuth2ImplicitGrantWithQueryParams: OAuth2ImplicitGrant {
4545
let dict = try parseAccessTokenResponse(params: params)
4646
logger?.debug("OAuth2", msg: "Successfully extracted access token")
4747
didAuthorize(withParameters: dict)
48+
return dict
4849
}
4950
catch let error {
5051
didFail(with: error.asOAuth2Error)
52+
throw error
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)