fix: resolve bugs found in pre-release review

This commit is contained in:
Mathis Maquenne
2026-08-05 21:33:08 +02:00
parent 5bb1448650
commit a695fb4de3
17 changed files with 258 additions and 60 deletions
+4 -1
View File
@@ -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