Skip to content

Commit

Permalink
Remove validation for OAuth native clientId in iOS plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
shilgapira committed Feb 29, 2024
1 parent 6f81119 commit 1426467
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions ios/Classes/DescopePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,9 @@ public class DescopePlugin: NSObject, FlutterPlugin, FlutterStreamHandler {

private func oauthNative(call: FlutterMethodCall, result: @escaping FlutterResult) {
guard let args = call.arguments as? [String: Any] else { return result(FlutterError(code: "MISSINGARGS", message: "Unexpected empty arguments in oauthNative", details: nil)) }
guard let clientId = args["clientId"] as? String else { return result(FlutterError(code: "MISSINGARGS", message: "'clientId' is required for oauthNative", details: nil)) }
guard let nonce = args["nonce"] as? String else { return result(FlutterError(code: "MISSINGARGS", message: "'nonce' is required for oauthNative", details: nil)) }
guard let implicit = args["implicit"] as? Bool else { return result(FlutterError(code: "MISSINGARGS", message: "'implicit' is required for oauthNative", details: nil)) }

if clientId != Bundle.main.bundleIdentifier {
return result(FlutterError(code: "FAILED", message: "OAuth provider clientId doesn't match bundle identifier", details: nil))
}

Task { @MainActor in
do {
let authorization = try await performAuthorization(nonce: nonce)
Expand Down

0 comments on commit 1426467

Please sign in to comment.