Commit 79c42231 authored by ale's avatar ale

Use short names for fields in the JSON-encoded session

Makes the authentication cookie quite shorter.
parent ab1f1f82
Pipeline #5408 passed with stages
in 3 minutes
......@@ -23,17 +23,17 @@ const maxFailures = 5
type Auth struct {
// True if the user is authenticated.
Authenticated bool
Authenticated bool `json:"a"`
// Deadline until authentication will need to be renewed.
Deadline time.Time
Deadline time.Time `json:"d"`
// User name and other information (like group membership).
Username string
UserInfo *auth.UserInfo
Username string `json:"u"`
UserInfo *auth.UserInfo `json:"ui"`
// Services the user has logged in to from this session.
Services []string
Services []string `json:"sv,omitempty"`
}
// AddService adds a service to the current session (if it's not
......@@ -51,10 +51,10 @@ type loginSession struct {
Auth
// Temporary fields required by the login process.
Password string
AuthResponse *auth.Response
Redir string
Failures int
Password string `json:"p"`
AuthResponse *auth.Response `json:"ar"`
Redir string `json:"r"`
Failures int `json:"fail"`
// Implementation detail of the session layer.
deleted bool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment