mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 05:37:05 +02:00
lastfm: loves import
This commit is contained in:
parent
1249238d3a
commit
406e150987
5 changed files with 57 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue