lastfm: authentication

This commit is contained in:
Philipp Wolfer 2023-11-23 23:14:47 +01:00
parent 3ccbb20a9e
commit 5b8f4788f9
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
10 changed files with 158 additions and 15 deletions

View file

@ -21,9 +21,9 @@ import (
"net/url"
)
func RunOauth2CallbackServer(redirectURL url.URL, responseChan chan CodeResponse) {
func RunOauth2CallbackServer(redirectURL url.URL, param string, responseChan chan CodeResponse) {
http.HandleFunc(redirectURL.Path, func(w http.ResponseWriter, r *http.Request) {
code := r.URL.Query().Get("code")
code := r.URL.Query().Get(param)
state := r.URL.Query().Get("state")
fmt.Fprint(w, "Token received, you can close this window now.")
responseChan <- CodeResponse{