Skip to content

Allow passing current time to decode #288

@seadowg

Description

@seadowg

👋 Hi! Thanks for creating such a simple to use JWT library.

One problem I've run into is that when using the exp functionality I am unable to write tests around expiration scenarios without using time-bending libraries such as Timecop. This isn't the worst thing in the world but I often find I end up in confusing scenarios due to losing the explicit control of what time is being passed to the method under test.

I'm happy to work on a PR if so but I was wondering if there are thoughts around being able to pass the current time to decode. Is this a change that would be accepted? If so, are there ideas around how it should be part of the decode signature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions