didier-coignet / idlecodes

application to automatically open chests in Idle Champions
0 stars 0 forks source link

Script fails if tokens are no longer valid for discord #1

Open Solace50 opened 1 year ago

Solace50 commented 1 year ago

Behaviour should be continue on error for 401 as reddit still works without auth

Starting idlecodes 32 codes from REDDIT Exception in thread "main" kotlinx.serialization.json.internal.JsonDecodingException: Expected start of the array '[', but had 'EOF' instead JSON input: {"message": "401: Unauthorized", "code": 0} at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24) at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32) at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:514) at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:219) at kotlinx.serialization.json.internal.AbstractJsonLexer.unexpectedToken(AbstractJsonLexer.kt:202) at kotlinx.serialization.json.internal.StringJsonLexer.consumeNextToken(StringJsonLexer.kt:70) at kotlinx.serialization.json.internal.StreamingJsonDecoder.beginStructure(StreamingJsonDecoder.kt:40) at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:29) at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43) at kotlinx.serialization.json.JsonArraySerializer.deserialize(JsonElementSerializers.kt:188) at kotlinx.serialization.json.JsonArraySerializer.deserialize(JsonElementSerializers.kt:170) at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59) at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:35) at kotlinx.serialization.json.Json.decodeFromString(Json.kt:100) at me.dco.CodesKt.getDiscordCodes(Codes.kt:53) at me.dco.MainKt.main(Main.kt:105)

didier-coignet commented 1 year ago

Hi thanks for the feedback. As a workaround you could just set the value of userToken to "" in settings.json. I'll get around to fix it sometime in the futur, because i don't use idles champions anymore.

Solace50 commented 1 year ago

The tokens expire over time and need to be changed. Defining elsewhere would not solve this

On Sat, Dec 10, 2022, 05:19 didier coignet @.***> wrote:

Hi thanks for the feedback. As a workaround you could just set the value of userToken to "" in settings.json. I'll get around to fix it sometime in the futur, because i don't use idles champions anymore.

— Reply to this email directly, view it on GitHub https://github.com/didier-coignet/idlecodes/issues/1#issuecomment-1345263653, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYHU642GHW7WTWWWKTWCSTWMR7NTANCNFSM6AAAAAASRE3CQY . You are receiving this because you authored the thread.Message ID: @.***>