Skip to content
Snippets Groups Projects
Commit 79c42231 authored by ale's avatar ale
Browse files

Use short names for fields in the JSON-encoded session

Makes the authentication cookie quite shorter.
parent ab1f1f82
Branches
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment