fix: resolve bugs found in pre-release review
This commit is contained in:
@@ -3,6 +3,7 @@ package deezer
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -10,6 +11,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var ErrInvalidARL = errors.New("invalid or expired ARL cookie")
|
||||
|
||||
type Session struct {
|
||||
APIToken string
|
||||
LicenseToken string
|
||||
@@ -71,7 +74,7 @@ func authenticate(ctx context.Context, arlCookie string) (*Session, error) {
|
||||
}
|
||||
|
||||
if res.Results.User.ID == 0 {
|
||||
return nil, fmt.Errorf("invalid or expired ARL cookie")
|
||||
return nil, ErrInvalidARL
|
||||
}
|
||||
|
||||
opts := res.Results.User.Options
|
||||
|
||||
Reference in New Issue
Block a user