Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Non-banged verify/2 throws exceptions #25

@nihalgonsalves

Description

@nihalgonsalves
iex(1)> JsonWebToken.verify("foobar", %{key: "barbaz"})    
** (RuntimeError) Failed to decode header from JSON
    (json_web_token) lib/json_web_token/jws.ex:95: JsonWebToken.Jws.header_map/1
    (json_web_token) lib/json_web_token/jws.ex:82: JsonWebToken.Jws.validate_alg_matched/2
    (json_web_token) lib/json_web_token/jws.ex:77: JsonWebToken.Jws.verify/3
    (json_web_token) lib/json_web_token/jwt.ex:89: JsonWebToken.Jwt.verify/2

I would expect that it should return {:error, "invalid"} or something similar, as it isn't the banged verify!/2 version of the function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions