Skip to content

Commit

Permalink
Simplify resumeWebAuth native code
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Nov 20, 2023
1 parent 24f2ebe commit cccd117
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ios/NativeBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ public class NativeBridge: NSObject {
}

@objc public func resumeWebAuth(url: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
if let value = URL(string: url) {
if (!WebAuthentication.resume(with: value)) {
reject("ERROR_PARSING_URL", "The callback url \(url) is invalid", nil)
}
if let value = URL(string: url), WebAuthentication.resume(with: value) {
resolve(true)
} else {
reject("ERROR_PARSING_URL", "The callback url \(url) is invalid", nil)
}
Expand Down

0 comments on commit cccd117

Please sign in to comment.