// ActivateAppUser is an endpoint for activating an app user func (v *DevAPI) ActivateAppUser(params *api.Request) api.Response { var token, found = filter.GetStringParameter("token", params.Form) if !found { return api.BadRequest(api.ErrInvalidInput) } var err = auth.ActivateAppUser(token) if err != nil { return api.BadRequest(err) } return api.PlainTextResponse(http.StatusOK, "Account is now active") }
// ActivateAccount activates an account using the activation token sent through email func (a *AuthAPI) ActivateAccount(params *api.Request) api.Response { var model = ActivateAccountModel{} var err = util.DeserializeJSON(params.Body, &model) if err != nil { return api.BadRequest(api.ErrEntityFormat) } err = auth.ActivateAppUser(model.Token) if err != nil { return api.BadRequest(err) } return api.StatusResponse(http.StatusOK) }