u
Anirudh Oppiliappan x@icyphox.sh
Tue, 26 Sep 2023 00:23:35 +0300
M
masto.go
→
masto.go
@@ -25,6 +25,12 @@ rw.Header().Set("Content-Type", "application/json; charset=utf-8")
rw.Write(j.ToBytes()) } +func showoauthlogin(rw http.ResponseWriter, r *http.Request) { + if err := readviews.Execute(rw, "oauthlogin.html", ""); err != nil { + elog.Println(err) + } +} + // https://docs.joinmastodon.org/methods/apps/#create func apiapps(rw http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil {
M
web.go
→
web.go
@@ -2871,6 +2871,7 @@ viewDir+"/views/msg.html",
viewDir+"/views/header.html", viewDir+"/views/onts.html", viewDir+"/views/emus.html", + viewDir+"/views/oauthlogin.html", viewDir+"/views/honkpage.js", ) if !develMode {@@ -2986,7 +2987,7 @@ // mastoshit
mastopost := mux.Methods("POST").Subrouter() mastoget := mux.Methods("GET").Subrouter() - mastoget.HandleFunc("/oauth/authorize", oauthorize) + mastoget.HandleFunc("/oauth/authorize", showoauthlogin) mastoget.HandleFunc("/api/v1/instance", instance) mastopost.HandleFunc("/api/v1/apps", apiapps)