Skip to content

Commit

Permalink
Fix login options request body (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaihanski authored Jan 25, 2024
1 parent 417e7ff commit caa1dbb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ written for Android. You can read more on the [Descope Website](https://descope.
Add the following to your `build.gradle` dependencies:

```groovy
implementation 'com.descope:descope-kotlin:0.9.7'
implementation 'com.descope:descope-kotlin:0.9.8'
```

## Quickstart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ internal class DescopeClient(internal val config: DescopeConfig) : HttpClient(co
"provider" to provider.name,
"redirectURL" to redirectUrl,
),
body = mapOf(
"loginOptions" to options?.toMap(),
),
body = options?.toMap() ?: emptyMap(),
)

suspend fun oauthWebExchange(code: String): JwtServerResponse = post(
Expand Down Expand Up @@ -408,9 +406,7 @@ internal class DescopeClient(internal val config: DescopeConfig) : HttpClient(co
"tenant" to emailOrTenantId,
"redirectURL" to redirectUrl,
),
body = mapOf(
"loginOptions" to options?.toMap(),
),
body = options?.toMap() ?: emptyMap(),
)

suspend fun ssoExchange(code: String): JwtServerResponse = post(
Expand Down
4 changes: 2 additions & 2 deletions descopesdk/src/main/java/com/descope/sdk/Routes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ interface DescopeOAuth {
* @param options additional behaviors to perform during authentication.
* @return a URL that starts the OAuth redirect chain
*/
suspend fun start(provider: OAuthProvider, redirectUrl: String?, options: List<SignInOptions>? = null): String
suspend fun start(provider: OAuthProvider, redirectUrl: String? = null, options: List<SignInOptions>? = null): String

/** @see start */
fun start(provider: OAuthProvider, redirectUrl: String?, options: List<SignInOptions>? = null, callback: (Result<String>) -> Unit)
fun start(provider: OAuthProvider, redirectUrl: String? = null, options: List<SignInOptions>? = null, callback: (Result<String>) -> Unit)

/**
* Completes an OAuth redirect chain.
Expand Down
2 changes: 1 addition & 1 deletion descopesdk/src/main/java/com/descope/sdk/Sdk.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ class DescopeSdk(val config: DescopeConfig) {
const val name = "DescopeAndroid"

/** The Descope SDK version */
const val version = "0.9.7"
const val version = "0.9.8"
}
}

0 comments on commit caa1dbb

Please sign in to comment.