Skip to content

Commit

Permalink
Merge branch 'jul/oidc' into 'master'
Browse files Browse the repository at this point in the history
Jul/oidc

See merge request TankerHQ/sdk-react-native!77
  • Loading branch information
Jeremy T committed Apr 6, 2022
2 parents 0895c9c + db7e402 commit 85488c0
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ class ClientReactNativeModule(reactContext: ReactApplicationContext) :
return tanker.stop().bridge(promise) { destroyTanker(handle) }
}

@ReactMethod()
fun createOidcNonce(handle: TankerHandle, promise: Promise) {
return getTanker(handle).createOidcNonce().bridge(promise)
}

@ReactMethod()
fun registerIdentity(
handle: TankerHandle,
Expand Down
13 changes: 13 additions & 0 deletions ios/ClientReactNative.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,19 @@ -(void) stopObserving {
return invalidHandleError(handle);
}

RCT_REMAP_METHOD(createOidcNonce, createOidcNonceWithTankerHandle:(nonnull NSNumber*)handle resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{
TKRTanker* tanker = [self.tankerInstanceMap objectForKey:handle];
if (!tanker)
return rejectInvalidHandle(reject, handle);

[tanker createOidcNonceWithCompletionHandler:^(NSString *nonce, NSError * _Nullable err) {
if (err != nil)
return rejectWithError(reject, err);
resolve(nonce);
}];
}

RCT_REMAP_METHOD(registerIdentity,
registerIdentityWithTankerHandle:(nonnull NSNumber*)handle
verification:(nonnull NSDictionary<NSString*, id>*)verificationDict
Expand Down
Loading

0 comments on commit 85488c0

Please sign in to comment.