Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.credentials.exceptions.GetCredentialException
import androidx.credentials.exceptions.NoCredentialException
import com.credentialsmanager.handlers.CredentialHandler
import com.credentialsmanager.handlers.ErrorHandler
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReadableArray
Expand Down Expand Up @@ -68,11 +69,11 @@ class CredentialsManagerModule(
credentialHandler.createPassword(username, password)

// Create success response
val result = mapOf(
"type" to "password",
"username" to username,
"success" to true
)
val result = Arguments.createMap().apply {
putString("type", "password")
putString("username", username)
putBoolean("success", true)
}
promise.resolve(result)
} catch (e: CreateCredentialException) {
ErrorHandler.handleCredentialError(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.credentials.exceptions.GetCredentialException
import androidx.credentials.exceptions.NoCredentialException
import com.credentialsmanager.handlers.CredentialHandler
import com.credentialsmanager.handlers.ErrorHandler
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
Expand Down Expand Up @@ -74,11 +75,11 @@ class CredentialsManagerModule(
credentialHandler.createPassword(username, password)

// Create success response
val result = mapOf(
"type" to "password",
"username" to username,
"success" to true
)
val result = Arguments.createMap().apply {
putString("type", "password")
putString("username", username)
putBoolean("success", true)
}
promise.resolve(result)
} catch (e: CreateCredentialException) {
ErrorHandler.handleCredentialError(e)
Expand Down
Loading