SDK
SDK Golang v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

GetCurrentUser #

Returns the profile object for the user linked to the JSON Web Token, provided in the query or the Authorization header.

Arguments #

Copied to clipboard!
func (a *Auth) GetCurrentUser() (*security.User, error)

Return #

A pointer to security.User object containing:

Property Type Description
Id
string
The user ID
Content
map[string]interface{}
The user content
ProfileIds
[]string
An array containing the profile ids

Usage #

Copied to clipboard!
kuzzle.Auth.Login("local", json.RawMessage("{\"username\":\"foo\",\"password\":\"bar\"}"), nil)
_, err := kuzzle.Auth.GetCurrentUser()
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("Success")
}