Skip to content

Dumb TokensClient Validate method #988

@sanchitrk

Description

@sanchitrk

This seems to be not the intended behavior, passing token has no effect on the method:
line

func (c *TokensClient) Validate(token string) (int64, error) {
	r, err := c.client.Get("/v1/auth/validate", nil)
	if err != nil {
		return 0, fmt.Errorf("failed to request validation: %s", err)
	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		return 0, fmt.Errorf("failed to validate token: %w", parseResponseError(r))
	}

The above still works as the Client.token is already set by pre auth run.

Perhaps using GetWithHeaders by passing the token should fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions