mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
[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:
parent
49e2acf186
commit
ac4312ffc4
1 changed files with 2 additions and 2 deletions
|
@ -236,7 +236,7 @@ func (c *Client) ValidateToken(ctx context.Context, force bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) getTwitchAppAccessToken() (string, error) {
|
func (c *Client) GetTwitchAppAccessToken() (string, error) {
|
||||||
if c.appAccessToken != "" {
|
if c.appAccessToken != "" {
|
||||||
return c.appAccessToken, nil
|
return c.appAccessToken, nil
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ func (c *Client) Request(opts ClientRequestOpts) error {
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
|
|
||||||
case AuthTypeAppAccessToken:
|
case AuthTypeAppAccessToken:
|
||||||
accessToken, err := c.getTwitchAppAccessToken()
|
accessToken, err := c.GetTwitchAppAccessToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "getting app-access-token")
|
return errors.Wrap(err, "getting app-access-token")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue