I have some stuff working with the spotify API for a mini project, but can't understand / get an implementation of the user login and authentication in Clojure.
I have the following code snippet to try and open the user auth:
(ns app-fig.spotify
(:require [clj-http.client :as client]))
(defn auth-user
[client-id]
(client/get "https://accounts.spotify.com/authorize" {:query-params
{"client_id" client-id
"response_type" "code"
"redirect_url" "http://localhost:3449/callback"
"scope" "playlist-modify-private"}}))
I get the following error in calva:
; Execution error (MalformedCookieException) at org.apache.http.impl.cookie.BasicExpiresHandler/parse (BasicExpiresHandler.java:64).
; Invalid 'expires' attribute: 2022-10-9 08:50:33.742
and the following warning in the terminal:
WARNING: Invalid cookie header: "set-cookie: __Host-sp_csrf_sid=360afea54e9aeacfa17925dcf1b3b2aae0ba4734b9b838751a450a6f32458da5; Path=/; HttpOnly; Secure; Expires=2022-10-9 08:32:57.829; Max-Age=3600; SameSite=Lax". Invalid 'expires' attribute: 2022-10-9 08:32:57.829
The spotify auth workflow is listed here.
Any assistance would be wonderful!