Files
2026-07-16 10:13:46 +03:30

11 lines
480 B
Go

package session
// UserIDKey is the string key under which we store the logged-in user's
// numeric ID inside the session (via sessions.Put(ctx, UserIDKey, id)).
//
// This constant exists so the key is spelled exactly once, in one place -
// every other file that touches this key (login, logout, the auth
// middleware) imports this constant instead of retyping the raw string
// "user_id", which would risk a typo silently breaking authentication.
const UserIDKey = "user_id"