5.2. GetUser: Log in using username and password

GetUser(username string, password string) (userdataptr *User, err error)

Obtains the User struct of a user who has already been initialized and returns a pointer to it.

Returns an error if:

  • there is no initialized user for the given username; or

  • the user credentials are invalid; or

  • the User struct cannot be obtained due to malicious action or the integrity of the User struct has been compromised.

Parameters
  • username (string) – Username

  • password (string) – Password

Return type

userdataptr, error

Warning

Do not forget that your design must satisfy all requirements, including:

  1. The client application must not use the local filesystem (see No Persistent Local State).

  2. Users can have multiple active user sessions at once (see User Sessions).

  3. You cannot use global variables to store user information (see Golang).