d49c3e167f
* New SessionState to consolidate email, access token and refresh token * split ServeHttp into individual methods * log on session renewal * log on access token refresh * refactor cookie encription/decription and session state serialization
18 lines
327 B
Go
18 lines
327 B
Go
package providers
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/bmizerany/assert"
|
|
)
|
|
|
|
func TestRefresh(t *testing.T) {
|
|
p := &ProviderData{}
|
|
refreshed, err := p.RefreshSessionIfNeeded(&SessionState{
|
|
ExpiresOn: time.Now().Add(time.Duration(-11) * time.Minute),
|
|
})
|
|
assert.Equal(t, false, refreshed)
|
|
assert.Equal(t, nil, err)
|
|
}
|