lastfm: loves import

This commit is contained in:
Philipp Wolfer 2023-11-26 12:56:27 +01:00
parent 1249238d3a
commit 406e150987
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
5 changed files with 57 additions and 6 deletions

View file

@ -47,5 +47,10 @@ func (s lastfmStrategy) AuthCodeURL(verifier string, state string) auth.AuthUrl
func (s lastfmStrategy) ExchangeToken(code auth.CodeResponse, verifier string) (*oauth2.Token, error) {
// The token is directly valid
return &oauth2.Token{AccessToken: code.Code}, nil
err := s.client.LoginWithToken(code.Code)
if err != nil {
return nil, err
}
sk := s.client.GetSessionKey()
return &oauth2.Token{AccessToken: sk}, nil
}