Merge pull request #2527 from ishank011/token-expiration

Set reva JWT token expiration time to 24 hours by default
This commit is contained in:
David Christofas
2021-09-23 04:46:00 -04:00
committed by GitHub
4 changed files with 6 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
Enhancement: Set reva JWT token expiration time to 24 hours by default
https://github.com/owncloud/ocis/pull/2527

View File

@@ -28,7 +28,7 @@ func Auth(opts ...account.Option) func(http.Handler) http.Handler {
opt := authOptions(opts...)
tokenManager, err := jwt.New(map[string]interface{}{
"secret": opt.JWTSecret,
"expires": int64(60),
"expires": int64(24 * 60 * 60),
})
if err != nil {
opt.Logger.Fatal().Err(err).Msgf("Could not initialize token-manager")

View File

@@ -40,7 +40,7 @@ func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler
opt := newAccountOptions(opts...)
tokenManager, err := jwt.New(map[string]interface{}{
"secret": opt.JWTSecret,
"expires": int64(60),
"expires": int64(24 * 60 * 60),
})
if err != nil {
opt.Logger.Fatal().Err(err).Msgf("Could not initialize token-manager")

View File

@@ -486,7 +486,7 @@ func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request) {
func (o Ocs) mintTokenForUser(ctx context.Context, account *accounts.Account) (string, error) {
tm, _ := jwt.New(map[string]interface{}{
"secret": o.config.TokenManager.JWTSecret,
"expires": int64(60),
"expires": int64(24 * 60 * 60),
})
u := &revauser.User{