Added the ability to configure the JWT expiry date using a new server.jwtttl config parameter. #999
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#999
Loading…
Reference in New Issue
No description provided.
Delete Branch "stephen-hill/api:feature/jwt-ttl"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As per the title, this update allows the JWT expiry date to be configurable from the config file.
I have updated the sample config file.
The default TTL is 3 days.
This is the first time writing Go code, and contributing to this project, so I'm happy to accept any feedback.
Thanks for the PR! It looks good overall.
Can you also run
mage generate-docs
to regenerate config docs?@ -55,2 +55,4 @@
t := jwt.New(jwt.SigningMethodHS256)
var ttl = time.Duration(config.ServiceJWTTTL.GetInt64())
var exp = time.Now().Add(time.Second * ttl).Unix()
Did you try
time.Second * config.ServiceJWTTTL.GetInt64()
? I'm not 100% sure that works, but IIRC it should.I did try that but got a type mismatch error.
Ah, I wasn't sure about that.
@konrad Docs regenerated.
Thanks again!
👀