From b6562aaae2dc0554973f5b6f567e7caf734b7d43 Mon Sep 17 00:00:00 2001 From: Diana Khortiuk Date: Tue, 11 Feb 2025 11:43:24 +0200 Subject: [PATCH] Fixed direct login function --- example/ios/Podfile.lock | 6 +++--- ios/FronteggRN.swift | 40 +++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c2fc5e5..ba0860e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -10,7 +10,7 @@ PODS: - React-jsi (= 0.72.1) - ReactCommon/turbomodule/core (= 0.72.1) - fmt (6.2.1) - - FronteggRN (1.2.8): + - FronteggRN (1.2.11): - FronteggSwift (= 1.2.32) - RCT-Folly (= 2021.07.22.00) - React-Core @@ -584,8 +584,8 @@ SPEC CHECKSUMS: FBLazyVector: 55cd4593d570bd9e5e227488d637ce6a9581ce51 FBReactNativeSpec: 799b0e1a1561699cd0e424e24fe5624da38402f0 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - FronteggRN: 3d200dc4972c49321233ec609ac8a391e7323024 - FronteggSwift: fe65e3758373aae89361d30aa3c5ec9b5d96fc18 + FronteggRN: 0fd4c3f1dca25855bb51aaff19bb57edc452719e + FronteggSwift: 5b377460184baa56924188cd6554e7c671cf0c99 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b hermes-engine: 9df83855a0fd15ef8eb61694652bae636b0c466e libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 diff --git a/ios/FronteggRN.swift b/ios/FronteggRN.swift index 384f46c..c4950b6 100644 --- a/ios/FronteggRN.swift +++ b/ios/FronteggRN.swift @@ -146,26 +146,28 @@ class FronteggRN: RCTEventEmitter { } - @objc - func directLoginAction( - _ type: String, - data: String, - ephemeralSession: Bool, - additionalQueryParams: [String: String]? = nil, - resolver: @escaping RCTPromiseResolveBlock, - rejecter: RCTPromiseRejectBlock - ) -> Void { - - fronteggApp.auth.directLoginAction( - window: nil, - type: type, - data: data, - ephemeralSession: ephemeralSession, - additionalQueryParams: additionalQueryParams - ) { _ in + @objc + func directLoginAction( + _ type: String, + data: String, + ephemeralSession: Bool, + additionalQueryParams: [String: String]? = nil, + resolver: @escaping RCTPromiseResolveBlock, + rejecter: @escaping RCTPromiseRejectBlock + ) -> Void { + + fronteggApp.auth.directLoginAction( + window: nil, + type: type, + data: data, + ephemeralSession: ephemeralSession, + _completion: { _ in resolver("Success") - } - } + }, + additionalQueryParams: additionalQueryParams + ) + } + @objc func refreshToken(_ resolve: @escaping RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock) -> Void {