Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implements CookieMaxAge value #245

Merged
merged 1 commit into from
May 16, 2020
Merged

Conversation

skromez
Copy link
Contributor

@skromez skromez commented May 4, 2020

implements a feature that allows to choose how long the cookie will be valid, and also using mw.Timeout value for a cookie isn't right, since it's just not possible to refresh a jwt if maxAge of cookie is the same as jwt timeout value if the user has chosen to store jwt in cookies

If you don't want to implement that feature I'd ask you to update maxAge value in cookie to be
expireCookie := mw.TimeFunc().Add(mw.CookieMaxAge)
maxage := int(expireCookie.Unix() - time.Now().Unix())
and not
expire := mw.TimeFunc().Add(mw.Timeout)
so user would be at least able to refresh a token if it's stored in cookies.

@appleboy appleboy merged commit b14510a into appleboy:master May 16, 2020
@skromez skromez deleted the feat/cookie-maxAge branch May 16, 2020 14:55
rayma-turingvideo added a commit to turingvideo/gin-jwt that referenced this pull request Jul 8, 2020
* chore: gin-jwt/v2 only support gin v1.5.0 or below (appleboy#238)

* udpate to gin 1.6.2 (appleboy#239)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* Fix documentation description of functions (appleboy#241)

* fixed readme descriptions

* fixed readme descriptions.

* chore: upgrade golang to 1.14 build

* chore: upgrade dependency

* Fix typo in README: Faliures -> Failures (appleboy#244)

* chore: upgrade gin to v1.6.3

* implements CookieMaxAge value (appleboy#245)

* docs: update comments of SigningAlgorithm field (appleboy#246)

* calculate cookie max-age using TimeFunc (appleboy#249)

* claim uuid for login and refresh

* go module

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: karimabedrabbo <karimnabedrabbo@gmail.com>
Co-authored-by: Andy Grunwald <andygrunwald@gmail.com>
Co-authored-by: skromez <42495435+skromez@users.noreply.github.com>
Co-authored-by: Jesús Rodríguez Pérez <jesusnoseq@hotmail.com>
Co-authored-by: Jorrit Salverda <JorritSalverda@users.noreply.github.com>
rayma-turingvideo added a commit to turingvideo/gin-jwt that referenced this pull request Jul 8, 2020
* chore: gin-jwt/v2 only support gin v1.5.0 or below (appleboy#238)

* udpate to gin 1.6.2 (appleboy#239)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* Fix documentation description of functions (appleboy#241)

* fixed readme descriptions

* fixed readme descriptions.

* chore: upgrade golang to 1.14 build

* chore: upgrade dependency

* Fix typo in README: Faliures -> Failures (appleboy#244)

* chore: upgrade gin to v1.6.3

* implements CookieMaxAge value (appleboy#245)

* docs: update comments of SigningAlgorithm field (appleboy#246)

* calculate cookie max-age using TimeFunc (appleboy#249)

* claim uuid for login and refresh

* go module

* fixes

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: karimabedrabbo <karimnabedrabbo@gmail.com>
Co-authored-by: Andy Grunwald <andygrunwald@gmail.com>
Co-authored-by: skromez <42495435+skromez@users.noreply.github.com>
Co-authored-by: Jesús Rodríguez Pérez <jesusnoseq@hotmail.com>
Co-authored-by: Jorrit Salverda <JorritSalverda@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants