Skip to content

Commit 2aa8f85

Browse files
committed
avoid useless jwt request on start
1 parent 6eeee73 commit 2aa8f85

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pluto-kotlin-client-sdk/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
defaultConfig {
1111
minSdkVersion 16
1212
targetSdkVersion 29
13-
versionCode 3
14-
versionName "0.1.2"
13+
versionCode 4
14+
versionName "0.1.3"
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
consumerProguardFiles 'consumer-rules.pro'
@@ -36,7 +36,7 @@ publishing {
3636
gpr(MavenPublication) {
3737
groupId "org.mushare"
3838
artifactId "pluto-kotlin-client-sdk"
39-
version "0.1.2"
39+
version "0.1.3"
4040
artifact sourceJar
4141
artifact "$buildDir/outputs/aar/pluto-kotlin-client-sdk-release.aar"
4242

pluto-kotlin-client-sdk/src/main/java/com/mushare/plutosdk/Pluto+Auth.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fun Pluto.getToken(completion: (String?) -> Unit) {
2323
completion(data.jwt)
2424
}
2525

26-
internal fun Pluto.refreshToken(completion: (String?) -> Unit) {
26+
private fun Pluto.refreshToken(completion: (String?) -> Unit) {
2727
val userId = data.userId
2828
val refreshToken = data.refreshToken
2929
if (userId == null || refreshToken == null) {

pluto-kotlin-client-sdk/src/main/java/com/mushare/plutosdk/Pluto.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Pluto private constructor() {
8686
}
8787

8888
init {
89-
refreshToken {
89+
getToken {
9090
state = if (it == null) {
9191
State.notSignin
9292
} else {

0 commit comments

Comments
 (0)