[core] Expose method to retrieve AppAccessToken

in order for libraries to for example instantiate an IGDB client easily

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-10-10 12:24:54 +02:00
parent 49e2acf186
commit ac4312ffc4
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -236,7 +236,7 @@ func (c *Client) ValidateToken(ctx context.Context, force bool) error {
return nil
}
func (c *Client) getTwitchAppAccessToken() (string, error) {
func (c *Client) GetTwitchAppAccessToken() (string, error) {
if c.appAccessToken != "" {
return c.appAccessToken, nil
}
@ -307,7 +307,7 @@ func (c *Client) Request(opts ClientRequestOpts) error {
// Nothing to do
case AuthTypeAppAccessToken:
accessToken, err := c.getTwitchAppAccessToken()
accessToken, err := c.GetTwitchAppAccessToken()
if err != nil {
return errors.Wrap(err, "getting app-access-token")
}