when login sessions to admin/account/webmail interfaces expiry or are no longer valid, explain the behaviour in the message

before, we would just say "session expired". now we say "session expired (after
12 hours inactivity)" (for admin) or "session expired (after 24 hours
inactivity)" for account/webmail. for unknown sessions in the admin interface,
we also explain that server restarts and 10 more new sessions can be the
reason.

for issue #202 by ally9335
This commit is contained in:
Mechiel Lukkien
2024-08-23 14:48:45 +02:00
parent dfe4a54e0b
commit a977082b89
8 changed files with 9 additions and 6 deletions

View File

@ -102,7 +102,7 @@ func sessionUse(ctx context.Context, log mlog.Log, accountName string, sessionTo
if !ok {
return LoginSession{}, fmt.Errorf("unknown session token")
} else if time.Until(ls.Expires) < 0 {
return LoginSession{}, fmt.Errorf("session expired")
return LoginSession{}, fmt.Errorf("session expired (after 24 hours inactivity)")
} else if csrfToken != "" && csrfToken != ls.csrfToken {
return LoginSession{}, fmt.Errorf("mismatch between csrf and session tokens")
}