Browse Source

SMS code representation

master
harture 7 years ago
parent
commit
809e6ee091
  1. 4
      definitions.go
  2. 8
      users.go

4
definitions.go

@ -661,3 +661,7 @@ type UserSessionRepresentation struct {
UserId *string `json:"userId,omitempty"`
Username *string `json:"username,omitempty"`
}
type SmsCodeRepresentation struct {
Code *string `json:"code,omitempty"`
}

8
users.go

@ -102,13 +102,15 @@ func (c *Client) ExecuteActionsEmail(accessToken string, realmName string, userI
}
// Send a new enrolment code and return it
func (c *Client) SendNewEnrolmentCode(accessToken string, realmName string, userID string) (string, error) {
func (c *Client) SendNewEnrolmentCode(accessToken string, realmName string, userID string) (SmsCodeRepresentation, error) {
var paramKV []string
paramKV = append(paramKV, "userid", userID)
var plugins = append(createQueryPlugins(paramKV...), url.Path(sendNewEnrolmentCode), url.Param("realm", realmName))
var resp = SmsCodeRepresentation{}
_, err := c.post(accessToken, &resp, plugins...)
return c.post(accessToken, nil, plugins...)
return resp, err
}
// GetCredentialsForUser gets the credential list for a user

Loading…
Cancel
Save