mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-15 17:39:04 -06:00
Merge pull request #2527 from ishank011/token-expiration
Set reva JWT token expiration time to 24 hours by default
This commit is contained in:
3
changelog/unreleased/reva-token-expiration.md
Normal file
3
changelog/unreleased/reva-token-expiration.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Enhancement: Set reva JWT token expiration time to 24 hours by default
|
||||
|
||||
https://github.com/owncloud/ocis/pull/2527
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user