aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-05-28 23:04:25 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-05-28 23:44:22 +0100
commit54e3f0f7d25b67a310128a3cb7f888ea3ee44e2b (patch)
tree283ebfcbd8ca5bd56d4c6765de7ff0ad724550f7 /cmd
parent69973a0c0cea573d444d46b5ae69bebc1567a9b8 (diff)
Set expiry time in the github auth package
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cashierd/main.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go
index 2a8d2b8..e509304 100644
--- a/cmd/cashierd/main.go
+++ b/cmd/cashierd/main.go
@@ -14,7 +14,6 @@ import (
"net/http"
"os"
"strings"
- "time"
"golang.org/x/oauth2"
@@ -133,11 +132,6 @@ func callbackHandler(a *appContext, w http.ResponseWriter, r *http.Request) (int
if err := a.authsession.Authorize(a.authprovider, code); err != nil {
return http.StatusInternalServerError, err
}
- // Github tokens don't have an expiry. Set one so that the session expires
- // after a period.
- if a.authsession.Token.Expiry.Unix() <= 0 {
- a.authsession.Token.Expiry = time.Now().Add(1 * time.Hour)
- }
a.setAuthCookie(w, r, a.authsession.Token)
http.Redirect(w, r, "/", http.StatusFound)
return http.StatusFound, nil