Documentation
¶
Overview ¶
Package createsession logs in: the name and password checked, a session made for the device.
Index ¶
Constants ¶
const Lifetime = 30 * 24 * time.Hour
Lifetime is how long a session lasts without use: each use starts it again (readtoken).
Variables ¶
var ErrBadCredentials = domain.Unauthorized("wrong name or password")
Functions ¶
func CheckPassword ¶
CheckPassword checks the name and password of an account and returns its id, in the same time whether the account exists or not: ErrBadCredentials either way, so the answer never tells which names exist. Without a name, the account is the base's only one, which the multi mode refuses. The OAuth consent checks it too, without a session.
Types ¶
type Input ¶
type Input struct {
// Name is the account's, any case: required in the multi mode, optional in the single one, where it must be the
// one account's.
Name string `json:"name,omitempty" binding:"optional"`
Password string `json:"password"`
// Token asks the token in the answer too, for a client without cookies (the CLI): the web keeps it HttpOnly.
Token bool `json:"token,omitempty" binding:"optional"`
}