diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d567846..16b0fd54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.1+1 +* Update `protectCookie` to only send `maxAge` when it is not `-1`. + # 1.1.1 * Added `protectCookie`, to better protect data sent in cookies. diff --git a/lib/src/plugin.dart b/lib/src/plugin.dart index fc56d993..df689774 100644 --- a/lib/src/plugin.dart +++ b/lib/src/plugin.dart @@ -172,10 +172,9 @@ class AngelAuth { cookie.domain ??= cookieDomain; } - cookie.maxAge ??= - _jwtLifeSpan < 0 ? -1 : _jwtLifeSpan ~/ Duration.millisecondsPerSecond; - if (_jwtLifeSpan > 0) { + cookie.maxAge ??= + _jwtLifeSpan < 0 ? -1 : _jwtLifeSpan ~/ Duration.millisecondsPerSecond; cookie.expires ??= new DateTime.now().add(new Duration(milliseconds: _jwtLifeSpan)); } diff --git a/pubspec.yaml b/pubspec.yaml index 293f2d26..b513c084 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: angel_auth description: A complete authentication plugin for Angel. -version: 1.1.1 +version: 1.1.1+1 author: Tobe O homepage: https://github.com/angel-dart/angel_auth environment: