Closed franklx closed 7 months ago
Hi, sorry for the wait. I'll try to get this reviewed within the next few days.
I'm working on an actix-web paseto-based authentication middleware: franklx/actix-paseto-auth-middleware.
When the _accesstoken is expired is convenient using it as base for creating a new one based on _refreshtoken (like original implementation based on jwt
does).
If you are interested here is where the token is created by calling a "polymorphic" function defined here where the set_expires_in
is called.
@franklx Thanks for clarifying. Off the top of my head, this seems fine to me. I'll get this merged and issue a new release.
Out in 0.6.8
.
Implemented new function
Claim::set_expires_in(&mut self, duration: &core::time::Duration) -> Result<(), Error>
useful for refreshing claims on expired tokens. Used it even fornew
andnew_expires_in
constructors.