Skip to content

Commit

Permalink
Merge pull request #29 from rafaelsq/lastfm
Browse files Browse the repository at this point in the history
Missing AccessToken for goth.User(Lastfm)
  • Loading branch information
markbates committed Mar 4, 2015
2 parents 27160fb + 947dbc6 commit 743e194
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ node_modules/
dist/
generated/
.vendor/
*.swp
3 changes: 2 additions & 1 deletion providers/lastfm/lastfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func (p *Provider) BeginAuth(state string) (goth.Session, error) {

// FetchUser will go to LastFM and access basic information about the user.
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
user := goth.User{}
sess := session.(*Session)
user := goth.User{AccessToken: sess.AccessToken}

u := struct {
XMLName xml.Name `xml:"user"`
Expand Down
1 change: 1 addition & 0 deletions providers/lastfm/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string,
if err != nil {
return "", err
}
s.AccessToken = sess["token"]
s.Login = sess["login"]
return sess["token"], err
}
Expand Down

0 comments on commit 743e194

Please sign in to comment.