Skip to content

Commit

Permalink
Expose Institutions option in Android SDK (#11)
Browse files Browse the repository at this point in the history
* Expose Institutions option in Android SDK

* institution is optional, connectionId is required in reconnect
  • Loading branch information
tom-quiltt authored Mar 8, 2024
1 parent 262bb71 commit bb8f906
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ interface QuilttConnectorConfiguration {
val connectorId: String
val oauthRedirectUrl: String
val connectionId: String?
val institution: String?
}

data class QuilttConnectorConnectConfiguration(
override val connectorId: String,
override val oauthRedirectUrl: String,
override val institution: String? = null,
) : QuilttConnectorConfiguration {
override val connectionId: String? = null // always null for connect, cannot be set
}

data class QuilttConnectorReconnectConfiguration(
override val connectorId: String,
override val oauthRedirectUrl: String,
override var connectionId: String?
) : QuilttConnectorConfiguration
override val connectionId: String,
) : QuilttConnectorConfiguration {
override val institution: String? = null // always null for reconnect, cannot be set
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class QuilttConnectorWebViewClient(private val params: QuilttConnectorWebViewCli
val tokenString = params.token ?: "null"
val connectorId = params.config.connectorId
val connectionId = params.config.connectionId ?: "null"
val institution = params.config.institution ?: "null"

val script = """
const options = {
Expand All @@ -125,6 +126,7 @@ class QuilttConnectorWebViewClient(private val params: QuilttConnectorWebViewCli
token: '$tokenString',
connectorId: '$connectorId',
connectionId: '$connectionId',
institution: '$institution',
};
const compactedOptions = Object.keys(options).reduce((acc, key) => {
if (options[key] !== 'null') {
Expand Down

0 comments on commit bb8f906

Please sign in to comment.