Skip to content

Commit 4fca6ea

Browse files
committed
ignore token on disabled jwt
1 parent eea353a commit 4fca6ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/spp/cli/PlatformCLI.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ object PlatformCLI : CliktCommand(name = "spp-cli", allowMultipleSubcommands = t
123123
if (resp.code in 200..299) {
124124
jwtToken = resp.body!!.string()
125125

126-
val decoded = JWT.decode(jwtToken)
127-
developer = Developer(decoded.getClaim("developer_id").asString())
126+
if (resp.code != 202) {
127+
val decoded = JWT.decode(jwtToken)
128+
developer = Developer(decoded.getClaim("developer_id").asString())
129+
}
128130
} else if (resp.code == 401 && accessToken.isNullOrEmpty()) {
129131
throw IllegalStateException("Connection failed. Reason: Missing access token")
130132
} else if (resp.code == 401) {

0 commit comments

Comments
 (0)