Browse Source

fix(admin): resolve login redirect loop in admin interface (#7272) (#7280)

- Configure proper cookie session options in admin server:
  * Set Path, MaxAge attributes
  * Ensure session cookies are correctly saved and retrieved

This resolves the issue where users entering correct admin credentials
would be redirected back to the login page due to improperly configured
session storage.

Fixes #7272
master
LeeXN 4 days ago
committed by GitHub
parent
commit
c5f15aaa25
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      weed/command/admin.go

7
weed/command/admin.go

@ -198,6 +198,13 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
return fmt.Errorf("failed to generate session key: %w", err)
}
store := cookie.NewStore(sessionKeyBytes)
// Configure session options to ensure cookies are properly saved
store.Options(sessions.Options{
Path: "/",
MaxAge: 3600 * 24, // 24 hours
})
r.Use(sessions.Sessions("admin-session", store))
// Static files - serve from embedded filesystem

Loading…
Cancel
Save