Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix login options request body #73

Merged
merged 3 commits into from
Jan 25, 2024
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
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"
}
}
Loading