mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
lastfm: authentication
This commit is contained in:
parent
3ccbb20a9e
commit
5b8f4788f9
10 changed files with 158 additions and 15 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue