diff options
| author | LeeXN <15145880789@163.com> | 2025-10-01 11:20:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 20:20:40 -0700 |
| commit | c5f15aaa25badfd577979ea32571887f0969f76c (patch) | |
| tree | 8b49abcff554391818b635a53c4cb061421299fa /weed | |
| parent | 0b51133fd30ef480a0b61c858848ac392c64f7a5 (diff) | |
| download | seaweedfs-c5f15aaa25badfd577979ea32571887f0969f76c.tar.xz seaweedfs-c5f15aaa25badfd577979ea32571887f0969f76c.zip | |
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
Diffstat (limited to 'weed')
| -rw-r--r-- | weed/command/admin.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/command/admin.go b/weed/command/admin.go index c1b55f105..8321aad80 100644 --- a/weed/command/admin.go +++ b/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 |
