Skip to content

Commit

Permalink
Add extension function for authenticateWithQuickConnect that takes th…
Browse files Browse the repository at this point in the history
…e secret directly (#382)
  • Loading branch information
nielsvanvelzen authored Apr 19, 2022
1 parent 127a102 commit cbdc3f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions jellyfin-api/api/jellyfin-api.api
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public final class org/jellyfin/sdk/api/client/extensions/ApiClientExtensionsKt

public final class org/jellyfin/sdk/api/client/extensions/UserApiExtensionsKt {
public static final fun authenticateUserByName (Lorg/jellyfin/sdk/api/operations/UserApi;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun authenticateWithQuickConnect (Lorg/jellyfin/sdk/api/operations/UserApi;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class org/jellyfin/sdk/api/client/util/ApiSerializer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ import org.jellyfin.sdk.api.client.Response
import org.jellyfin.sdk.api.operations.UserApi
import org.jellyfin.sdk.model.api.AuthenticateUserByName
import org.jellyfin.sdk.model.api.AuthenticationResult
import org.jellyfin.sdk.model.api.QuickConnectDto

/**
* Extension function for the authenticateUserByName operation that accepts the username and password directly
*/
public suspend inline fun UserApi.authenticateUserByName(
username: String,
password: String
password: String,
): Response<AuthenticationResult> = authenticateUserByName(
data = AuthenticateUserByName(
username = username,
pw = password
)
)

/**
* Extension function for the authenticateWithQuickConnect operation that accepts the secret directly
*/
public suspend inline fun UserApi.authenticateWithQuickConnect(
secret: String,
): Response<AuthenticationResult> = authenticateWithQuickConnect(
data = QuickConnectDto(
secret = secret
)
)

0 comments on commit cbdc3f8

Please sign in to comment.