go-chi / jwtauth

JWT authentication middleware for Go HTTP services
MIT License
543 stars 91 forks source link

Token expiry #3

Closed pkieltyka closed 8 years ago

pkieltyka commented 8 years ago

Let's check the conventional "exp" claim field for the value to check if the current time past the present time. If so, we should return a 401.

pkieltyka commented 8 years ago

We should also add a simple method when making a new token that lets the expiry of a token. I propose a package-level function in the jwtauth pacakge like..

func ExpValue(time time.Time) int64 {
  // assuming we're to return a unix epoch time.. 
}