From afc602a708760b8907c002c4667e9ee134526570 Mon Sep 17 00:00:00 2001 From: Rool Paap Date: Tue, 6 Dec 2022 11:25:55 +0100 Subject: [PATCH] Update for RDO Module changes --- CTRTests/Spies/Services/OpenIdManagerSpy.swift | 9 +++++---- .../Holder/Event/Login/AuthenticationViewModel.swift | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CTRTests/Spies/Services/OpenIdManagerSpy.swift b/CTRTests/Spies/Services/OpenIdManagerSpy.swift index dd142aae6..693ecb958 100644 --- a/CTRTests/Spies/Services/OpenIdManagerSpy.swift +++ b/CTRTests/Spies/Services/OpenIdManagerSpy.swift @@ -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) } diff --git a/Sources/CTR/Interface/Holder/Event/Login/AuthenticationViewModel.swift b/Sources/CTR/Interface/Holder/Event/Login/AuthenticationViewModel.swift index 5800d4740..8ea3a0421 100644 --- a/Sources/CTR/Interface/Holder/Event/Login/AuthenticationViewModel.swift +++ b/Sources/CTR/Interface/Holder/Event/Login/AuthenticationViewModel.swift @@ -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