jonasroussel / dart_jsonwebtoken

A dart implementation of the famous javascript library 'jsonwebtoken'
MIT License
87 stars 29 forks source link

issue on payload id #3

Closed parkmap closed 3 years ago

parkmap commented 3 years ago

Crashed at payload Id is not defined or is not int value.

is not acceptable to change string value at first JWT?

crash case final jwt = JWT( { 'id': 'text', 'server': { 'id': '3e4fc296', 'loc': 'euw-2', } }, issuer: 'https://github.com/jonasroussel/jsonwebtoken', );

work case final jwt = JWT( { 'id': 123, 'server': { 'id': '3e4fc296', 'loc': 'euw-2', } }, issuer: 'https://github.com/jonasroussel/jsonwebtoken', );

jonasroussel commented 3 years ago

Hello,

payload is dynamic, so accept any types of values. I tried your crash case and its works for me, do you have the last version ?

parkmap commented 3 years ago

Hi, Thanks for comment!

I guess only my project have this issue.. maybe some state conflict issue. I don't know the problem yet..

logs is below


I/flutter ( 8664): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 8664): The following _TypeError was thrown building _BodyBuilder: I/flutter ( 8664): type 'int' is not a subtype of type 'String' of 'value' I/flutter ( 8664): The relevant error-causing widget was: I/flutter ( 8664): Scaffold...

I got this error only on crash case.