invite token -> 'invToken' (#820, #834)

This commit is contained in:
Michael Quigley 2025-02-04 11:34:34 -05:00
parent 503dd432c9
commit d2bebc9151
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
10 changed files with 33 additions and 33 deletions

View File

@ -75,11 +75,11 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) {
} }
if cmd.tui.done { if cmd.tui.done {
email := cmd.tui.emailInputs[0].Value() email := cmd.tui.emailInputs[0].Value()
token := cmd.tui.tokenInput.Value() invToken := cmd.tui.tokenInput.Value()
req := account.NewInviteParams() req := account.NewInviteParams()
req.Body.Email = email req.Body.Email = email
req.Body.Token = token req.Body.InvToken = invToken
_, err = zrok.Account.Invite(req) _, err = zrok.Account.Invite(req)
if err != nil { if err != nil {
cmd.endpointError(env.ApiEndpoint()) cmd.endpointError(env.ApiEndpoint())

View File

@ -43,9 +43,9 @@ func (h *inviteHandler) Handle(params account.InviteParams) middleware.Responder
defer func() { _ = tx.Rollback() }() defer func() { _ = tx.Rollback() }()
if h.cfg.Invites != nil && h.cfg.Invites.TokenStrategy == "store" { if h.cfg.Invites != nil && h.cfg.Invites.TokenStrategy == "store" {
inviteToken, err := str.FindInviteTokenByToken(params.Body.Token, tx) inviteToken, err := str.FindInviteTokenByToken(params.Body.InvToken, tx)
if err != nil { if err != nil {
logrus.Errorf("cannot get invite token '%v' for '%v': %v", params.Body.Token, params.Body.Email, err) logrus.Errorf("cannot get invite token '%v' for '%v': %v", params.Body.InvToken, params.Body.Email, err)
return account.NewInviteBadRequest().WithPayload("missing invite token") return account.NewInviteBadRequest().WithPayload("missing invite token")
} }
if err := str.DeleteInviteToken(inviteToken.Id, tx); err != nil { if err := str.DeleteInviteToken(inviteToken.Id, tx); err != nil {

View File

@ -297,8 +297,8 @@ type InviteBody struct {
// email // email
Email string `json:"email,omitempty"` Email string `json:"email,omitempty"`
// token // inv token
Token string `json:"token,omitempty"` InvToken string `json:"invToken,omitempty"`
} }
// Validate validates this invite body // Validate validates this invite body

View File

@ -732,7 +732,7 @@ func init() {
"email": { "email": {
"type": "string" "type": "string"
}, },
"token": { "invToken": {
"type": "string" "type": "string"
} }
} }
@ -2909,7 +2909,7 @@ func init() {
"email": { "email": {
"type": "string" "type": "string"
}, },
"token": { "invToken": {
"type": "string" "type": "string"
} }
} }

View File

@ -66,8 +66,8 @@ type InviteBody struct {
// email // email
Email string `json:"email,omitempty"` Email string `json:"email,omitempty"`
// token // inv token
Token string `json:"token,omitempty"` InvToken string `json:"invToken,omitempty"`
} }
// Validate validates this invite body // Validate validates this invite body

View File

@ -14,7 +14,7 @@ import { RequestFile } from './models';
export class InviteRequest { export class InviteRequest {
'email'?: string; 'email'?: string;
'token'?: string; 'invToken'?: string;
static discriminator: string | undefined = undefined; static discriminator: string | undefined = undefined;
@ -25,8 +25,8 @@ export class InviteRequest {
"type": "string" "type": "string"
}, },
{ {
"name": "token", "name": "invToken",
"baseName": "token", "baseName": "invToken",
"type": "string" "type": "string"
} ]; } ];

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**email** | **str** | | [optional] **email** | **str** | | [optional]
**token** | **str** | | [optional] **inv_token** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -29,23 +29,23 @@ class InviteBody(object):
""" """
swagger_types = { swagger_types = {
'email': 'str', 'email': 'str',
'token': 'str' 'inv_token': 'str'
} }
attribute_map = { attribute_map = {
'email': 'email', 'email': 'email',
'token': 'token' 'inv_token': 'invToken'
} }
def __init__(self, email=None, token=None): # noqa: E501 def __init__(self, email=None, inv_token=None): # noqa: E501
"""InviteBody - a model defined in Swagger""" # noqa: E501 """InviteBody - a model defined in Swagger""" # noqa: E501
self._email = None self._email = None
self._token = None self._inv_token = None
self.discriminator = None self.discriminator = None
if email is not None: if email is not None:
self.email = email self.email = email
if token is not None: if inv_token is not None:
self.token = token self.inv_token = inv_token
@property @property
def email(self): def email(self):
@ -69,25 +69,25 @@ class InviteBody(object):
self._email = email self._email = email
@property @property
def token(self): def inv_token(self):
"""Gets the token of this InviteBody. # noqa: E501 """Gets the inv_token of this InviteBody. # noqa: E501
:return: The token of this InviteBody. # noqa: E501 :return: The inv_token of this InviteBody. # noqa: E501
:rtype: str :rtype: str
""" """
return self._token return self._inv_token
@token.setter @inv_token.setter
def token(self, token): def inv_token(self, inv_token):
"""Sets the token of this InviteBody. """Sets the inv_token of this InviteBody.
:param token: The token of this InviteBody. # noqa: E501 :param inv_token: The inv_token of this InviteBody. # noqa: E501
:type: str :type: str
""" """
self._token = token self._inv_token = inv_token
def to_dict(self): def to_dict(self):
"""Returns the model properties as a dict""" """Returns the model properties as a dict"""

View File

@ -59,7 +59,7 @@ paths:
properties: properties:
email: email:
type: string type: string
token: invToken:
type: string type: string
responses: responses:
201: 201:

View File

@ -30,7 +30,7 @@ export interface InviteRequest {
* @type {string} * @type {string}
* @memberof InviteRequest * @memberof InviteRequest
*/ */
token?: string; invToken?: string;
} }
/** /**
@ -51,7 +51,7 @@ export function InviteRequestFromJSONTyped(json: any, ignoreDiscriminator: boole
return { return {
'email': json['email'] == null ? undefined : json['email'], 'email': json['email'] == null ? undefined : json['email'],
'token': json['token'] == null ? undefined : json['token'], 'invToken': json['invToken'] == null ? undefined : json['invToken'],
}; };
} }
@ -62,7 +62,7 @@ export function InviteRequestToJSON(value?: InviteRequest | null): any {
return { return {
'email': value['email'], 'email': value['email'],
'token': value['token'], 'invToken': value['invToken'],
}; };
} }