Skip to content

Proposal: Populate Token.ExpiresIn when converting from internal.Token #746

Open
@soh335

Description

@soh335

The Token.ExpiresIn field was added in golang/go#61417. However, when retrieving a Token via methods like Config.Exchange, even though the server may return an expires_in value, only the Token.Expiry field is updated, and the Token.ExpiresIn field remains unset.

While Token.Expiry is generally sufficient, it seems confusing to have an ExpiresIn field present but left as a zero value. What do you think about populating the Token.ExpiresIn field when converting from internal.Token to Token?

#748

Alternatively, how about clarifying in the documentation for the ExpiresIn field that methods like Config.Exchange within the oauth2 package do not populate the Token.ExpiresIn field?

#747

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions