File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed
android/src/main/java/com/authsignal/react Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,16 @@ class AuthsignalPushModule(private val reactContext: ReactApplicationContext) :
4646 val errorCode = response.errorCode ? : defaultError
4747
4848 promise.reject(errorCode, response.error)
49- } else {
49+ } else if (response.data != null ) {
5050 val credential = response.data
5151 val map = Arguments .createMap()
5252 map.putString(" credentialId" , credential!! .credentialId)
5353 map.putString(" createdAt" , credential.createdAt)
5454 map.putString(" userId" , credential.userId)
5555 map.putString(" lastAuthenticatedAt" , credential.lastAuthenticatedAt)
5656 promise.resolve(map)
57+ } else {
58+ promise.resolve(null )
5759 }
5860 }
5961 }
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-authsignal" ,
3- "version" : " 2.0.0-alpha3 " ,
3+ "version" : " 2.0.0-alpha4 " ,
44 "description" : " The official Authsignal React Native library." ,
55 "main" : " lib/commonjs/index" ,
66 "module" : " lib/module/index" ,
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ export class AuthsignalInApp {
3737 this . enableLogging = enableLogging ;
3838 }
3939
40- async getCredential ( ) : Promise < AuthsignalResponse < AppCredential > > {
40+ async getCredential ( ) : Promise <
41+ AuthsignalResponse < AppCredential | undefined >
42+ > {
4143 await this . ensureModuleIsInitialized ( ) ;
4244
4345 try {
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ export class AuthsignalPush {
3838 this . enableLogging = enableLogging ;
3939 }
4040
41- async getCredential ( ) : Promise < AuthsignalResponse < AppCredential > > {
41+ async getCredential ( ) : Promise <
42+ AuthsignalResponse < AppCredential | undefined >
43+ > {
4244 await this . ensureModuleIsInitialized ( ) ;
4345
4446 try {
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ export class AuthsignalQrCode {
3939 this . enableLogging = enableLogging ;
4040 }
4141
42- async getCredential ( ) : Promise < AuthsignalResponse < AppCredential > > {
42+ async getCredential ( ) : Promise <
43+ AuthsignalResponse < AppCredential | undefined >
44+ > {
4345 await this . ensureModuleIsInitialized ( ) ;
4446
4547 try {
You can’t perform that action at this time.
0 commit comments