Skip to content

Commit

Permalink
Merge pull request #2177 from minvws/chore/modules-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rool authored Dec 6, 2022
2 parents 3b4dd57 + afc602a commit 5235ad1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CTRTests/Spies/Services/OpenIdManagerSpy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ class OpenIdManagerSpy: OpenIDConnectManaging {

var invokedRequestAccessToken = false
var invokedRequestAccessTokenCount = 0
var invokedRequestAccessTokenParameters: (issuerConfiguration: OpenIDConnectConfiguration, presentingViewController: UIViewController?)?
var invokedRequestAccessTokenParametersList = [(issuerConfiguration: OpenIDConnectConfiguration, presentingViewController: UIViewController?)]()
var invokedRequestAccessTokenParameters: (issuerConfiguration: OpenIDConnectConfiguration, presentingViewController: UIViewController?, openIDConnectState: OpenIDConnectState?)?
var invokedRequestAccessTokenParametersList = [(issuerConfiguration: OpenIDConnectConfiguration, presentingViewController: UIViewController?, openIDConnectState: OpenIDConnectState?)]()
var stubbedRequestAccessTokenOnCompletionResult: (OpenIDConnectToken, Void)?
var stubbedRequestAccessTokenOnErrorResult: (Error?, Void)?

func requestAccessToken(
issuerConfiguration: OpenIDConnectConfiguration,
presentingViewController: UIViewController?,
openIDConnectState: OpenIDConnectState?,
onCompletion: @escaping (OpenIDConnectToken) -> Void,
onError: @escaping (Error?) -> Void) {
invokedRequestAccessToken = true
invokedRequestAccessTokenCount += 1
invokedRequestAccessTokenParameters = (issuerConfiguration, presentingViewController)
invokedRequestAccessTokenParametersList.append((issuerConfiguration, presentingViewController))
invokedRequestAccessTokenParameters = (issuerConfiguration, presentingViewController, openIDConnectState)
invokedRequestAccessTokenParametersList.append((issuerConfiguration, presentingViewController, openIDConnectState))
if let result = stubbedRequestAccessTokenOnCompletionResult {
onCompletion(result.0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class AuthenticationViewModel {
// use the internal browser for pap,
// use the external browser for tvs (because the Digid app redirects to external browser)
presentingViewController: authenticationMode == .patientAuthenticationProvider ? presentingViewController : nil,
openIDConnectState: openIDConnectState,
onCompletion: { token in

self.shouldShowProgress = false
Expand Down

0 comments on commit 5235ad1

Please sign in to comment.