Skip to content

Commit

Permalink
Merge branch 'EWC-consortium:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
josmilan authored Sep 2, 2024
2 parents 0f595e4 + a8d2727 commit 19a0933
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/eudiWalletOidcIos/Service/VerificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,13 @@ public class VerificationService: NSObject, VerificationServiceProtocol {
if httpres?.statusCode == 302 || httpres?.statusCode == 200 {
if let location = httpres?.value(forHTTPHeaderField: "Location") {
responseUrl = location
return WrappedVerificationResponse(data: responseUrl, error: nil)
let url = URL.init(string: location)
if let errorDescription = url?.queryParameters?["error_description"] as? String {
let error = errorDescription.replacingOccurrences(of: "+", with: " ").data(using: .utf8)
return WrappedVerificationResponse(data: nil, error: ErrorHandler.processError(data: error))
} else {
return WrappedVerificationResponse(data: responseUrl, error: nil)
}
} else {
return WrappedVerificationResponse(data: "https://www.example.com?code=1", error: nil)
}
Expand Down

0 comments on commit 19a0933

Please sign in to comment.