all repos — honk @ 7ef1ff5bc01bbb8dc571f4699a67b83d1599e456

my fork of honk

u
Anirudh Oppiliappan x@icyphox.sh
Tue, 26 Sep 2023 23:32:24 +0300
commit

7ef1ff5bc01bbb8dc571f4699a67b83d1599e456

parent

78d348247dbfc692c9ff1600cdfa44ef885fcd2e

1 files changed, 5 insertions(+), 7 deletions(-)

jump to
M masto.gomasto.go

@@ -1,6 +1,7 @@

package main import ( + "database/sql" "fmt" "net/http"

@@ -56,14 +57,11 @@ }

// https://docs.joinmastodon.org/methods/oauth/#authorize func oauthorize(rw http.ResponseWriter, r *http.Request) { - clientID := r.Form.Get("client_id") - redirectURI := r.Form.Get("redirect_uri") + clientID := r.FormValue("client_id") + redirectURI := r.FormValue("redirect_uri") - fmt.Println("redirectURI", redirectURI) - fmt.Println("clientID", clientID) - - _, err := stmtCheckClientId.Exec(clientID) - if err != nil { + err := stmtCheckClientId.QueryRow(clientID).Scan() + if err == sql.ErrNoRows { elog.Println("oauth: no such client:", clientID) rw.WriteHeader(http.StatusUnauthorized) return