@@ -4,6 +4,7 @@ import (
44 "net/url"
55 "strings"
66 "testing"
7+ "time"
78
89 "github.com/bmizerany/assert"
910)
@@ -125,3 +126,15 @@ func TestPassAccessTokenRequiresSpecificCookieSecretLengths(t *testing.T) {
125126 o.CookieSecret = "32 byte secret for AES-256------"
126127 assert.Equal(t, nil, o.Validate())
127128}
129+
130+func TestCookieRefreshMustBeLessThanCookieExpire(t *testing.T) {
131+ o := testOptions()
132+ assert.Equal(t, nil, o.Validate())
133+
134+ o.CookieSecret = "0123456789abcdef"
135+ o.CookieRefresh = o.CookieExpire
136+ assert.NotEqual(t, nil, o.Validate())
137+
138+ o.CookieRefresh -= time.Duration(1)
139+ assert.Equal(t, nil, o.Validate())
140+}