Skip to content

Commit ba8e86b

Browse files
EXAMPLEIOS-88 Implement no profile custom registration feature
-fixed remarks
1 parent d0ac685 commit ba8e86b

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

OneWelcomeExampleApp/Interactors/RegisterUserInteractor.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ extension RegisterUserInteractor: RegisterUserInteractorProtocol {
4646
}
4747

4848
func startUserRegistration(identityProvider: IdentityProvider?) {
49-
guard let identityProvider else {
50-
let error = AppError(errorDescription: "No identity provider chosen.")
51-
registerUserPresenter?.registerUserActionFailed(error)
52-
return
53-
}
54-
55-
switch AllowedIdentityProviders(rawValue: identityProvider.identifier) {
49+
switch AllowedIdentityProviders(rawValue: identityProvider?.identifier ?? "") {
5650
case .stateless, .twoWayStateless:
5751
userClient.registerStatelessUserWith(identityProvider: identityProvider, scopes: ["read", "openid"], delegate: self)
5852
default:

OneWelcomeExampleApp/Interactors/StartupInteractor.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ protocol StartupInteractorProtocol {
2222

2323
class StartupInteractor: StartupInteractorProtocol {
2424
func oneginiSDKStartup(completion: @escaping (AppError?) -> Void) {
25-
ClientBuilder().build().start { error in
26-
completion(error.flatMap { ErrorMapper().mapError($0) })
25+
ClientBuilder().buildAndWaitForProtectedData { client in
26+
client.start { error in
27+
completion(error.flatMap { ErrorMapper().mapError($0) })
28+
}
2729
}
2830
}
2931
}

widget/Startup.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import OneginiSDKiOS
55
class Startup {
66

77
func oneginiSDKStartup(completion: @escaping (Bool) -> Void) {
8-
ClientBuilder().build().start { error in
9-
completion(error == nil)
8+
ClientBuilder().buildAndWaitForProtectedData { client in
9+
client.start { error in
10+
completion(error == nil)
11+
}
1012
}
1113
}
1214
}

0 commit comments

Comments
 (0)