diff options
author | jloup <jeanloup.jamet@gmail.com> | 2018-04-16 09:56:19 +0200 |
---|---|---|
committer | jloup <jeanloup.jamet@gmail.com> | 2018-04-16 09:56:19 +0200 |
commit | 1fc43bfa508b3579ca5a8944f8fc3e84cacee500 (patch) | |
tree | 84ed48a579b875cf215adf74e333a690f3459b0a | |
parent | 82a14eda4a89c2f2e98b79941422b77d6eded5ef (diff) | |
download | Front-1fc43bfa508b3579ca5a8944f8fc3e84cacee500.tar.gz Front-1fc43bfa508b3579ca5a8944f8fc3e84cacee500.tar.zst Front-1fc43bfa508b3579ca5a8944f8fc3e84cacee500.zip |
Set session expire to 7 days.v0.0.4
-rw-r--r-- | api/auth_jwt.go | 2 | ||||
-rw-r--r-- | cmd/web/js/app.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/api/auth_jwt.go b/api/auth_jwt.go index f713f4e..5ce1593 100644 --- a/api/auth_jwt.go +++ b/api/auth_jwt.go | |||
@@ -61,7 +61,7 @@ func CreateJwtToken(userId int64) (string, error) { | |||
61 | false, | 61 | false, |
62 | userId, | 62 | userId, |
63 | jwt.StandardClaims{ | 63 | jwt.StandardClaims{ |
64 | ExpiresAt: time.Now().Add(time.Hour * 24).Unix(), | 64 | ExpiresAt: time.Now().Add(time.Hour * 24 * 7).Unix(), |
65 | }, | 65 | }, |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/cmd/web/js/app.js b/cmd/web/js/app.js index d8189e0..5ac4335 100644 --- a/cmd/web/js/app.js +++ b/cmd/web/js/app.js | |||
@@ -6,7 +6,7 @@ import React from 'react'; | |||
6 | import ReactDOM from 'react-dom'; | 6 | import ReactDOM from 'react-dom'; |
7 | 7 | ||
8 | var App = {}; | 8 | var App = {}; |
9 | var cookieExpire = 60 * 30; | 9 | var cookieExpire = 60 * 60 * 7; |
10 | 10 | ||
11 | App.errorCodeToMessage = function(code) { | 11 | App.errorCodeToMessage = function(code) { |
12 | switch (code) { | 12 | switch (code) { |