Skip to content

Commit f069b2b

Browse files
added uses of reactApplicationContext for activities
1 parent 39d123c commit f069b2b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

android/src/main/java/com/frontegg/reactnative/FronteggRNModule.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
119119

120120
@ReactMethod
121121
fun login(loginHint: String?, promise: Promise) {
122-
val activity = currentActivity
122+
val activity = reactApplicationContext.currentActivity
123123
auth.login(activity!!, loginHint) {
124124
promise.resolve("")
125125
}
@@ -134,7 +134,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
134134

135135
@ReactMethod
136136
fun directLoginAction(type: String, data: String, ephemeralSession: Boolean, promise: Promise) {
137-
val activity = currentActivity
137+
val activity = reactApplicationContext.currentActivity
138138
auth.directLoginAction(activity!!, type, data)
139139
promise.resolve(true)
140140
}
@@ -147,7 +147,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
147147

148148
@ReactMethod
149149
fun loginWithPasskeys(promise: Promise) {
150-
val activity = currentActivity
150+
val activity = reactApplicationContext.currentActivity
151151
auth.loginWithPasskeys(activity!!) { error ->
152152
if (error != null) {
153153
promise.reject(error)
@@ -179,7 +179,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
179179

180180
@ReactMethod
181181
fun registerPasskeys(promise: Promise) {
182-
val activity = currentActivity
182+
val activity = reactApplicationContext.currentActivity
183183
auth.registerPasskeys(activity!!) { error ->
184184
if (error != null) {
185185
promise.reject(error)

0 commit comments

Comments
 (0)