Skip to content

Commit

Permalink
feat(android-sdk): add get access token without a org id method
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyijun committed Feb 19, 2024
1 parent 50e85bf commit 60059cd
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,22 @@ open class LogtoClient(
}

/**
* Get access token
* Get access token without resource and organization id
* @param[completion] the completion which handles the result
*/
fun getAccessToken(completion: Completion<LogtoException, AccessToken>) =
getAccessToken(null, null, completion)

/**
* Get access token by resource without a organization id
* @param[completion] the completion which handles the result
*/
fun getAccessToken(resource: String?, completion: Completion<LogtoException, AccessToken>) =
getAccessToken(resource, null, completion)

Check warning on line 192 in android-sdk/android/src/main/kotlin/io/logto/sdk/android/LogtoClient.kt

View check run for this annotation

Codecov / codecov/patch

android-sdk/android/src/main/kotlin/io/logto/sdk/android/LogtoClient.kt#L192

Added line #L192 was not covered by tests

/**
* Get the access token for the specified organization with refresh strategy.
*
* Scope `UserScope.Organizations` is required in the config to use organization-related methods.
*
*/
fun getOrganizationToken(
organizationId: String,
Expand Down

0 comments on commit 60059cd

Please sign in to comment.