Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print error when value is not str type #40

Closed
tyki6 opened this issue Jan 6, 2021 · 0 comments · Fixed by #41
Closed

Print error when value is not str type #40

tyki6 opened this issue Jan 6, 2021 · 0 comments · Fixed by #41
Assignees
Labels
bug Something isn't working

Comments

@tyki6
Copy link
Owner

tyki6 commented Jan 6, 2021

Context

bug when jwt get a value with type is not str.

Process

myjwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Expected result

Your jwt is:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Your jwt decoded is:

Header:
alg = HS256
typ = JWT

Payload:
sub = 1234567890
name = John Doe
iat = 1516239022

Current result

Your jwt is:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Your jwt decoded is:

Header:
alg = HS256
typ = JWT

Payload:
sub = 1234567890
name = John Doe
Traceback (most recent call last):
TypeError: can only concatenate str (not "int") to str
@tyki6 tyki6 added the bug Something isn't working label Jan 6, 2021
@tyki6 tyki6 self-assigned this Jan 6, 2021
@tyki6 tyki6 changed the title Error when value is not str type Print error when value is not str type Jan 6, 2021
@tyki6 tyki6 closed this as completed in #41 Jan 9, 2021
tyki6 added a commit that referenced this issue Jan 9, 2021
* fix #40: print Error when value is not str type

* copy new jwt to clipboard

* color output for cli

* color output for user_interface

* update help text (--help)

* update test for color output

* fix unit test

* info clipboard

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant