]> Vexing Labs - dead-tooter.git/commitdiff
Working account authentication, despite missing required field in masto docs.
authorAdam Shamblin <adam@vexingworkshop.com>
Mon, 12 Dec 2022 23:04:52 +0000 (16:04 -0700)
committerAdam Shamblin <adam@vexingworkshop.com>
Mon, 12 Dec 2022 23:04:52 +0000 (16:04 -0700)
main.go
pkg/mastodon/account.go

diff --git a/main.go b/main.go
index ce3a4862fb8cf0b08015b3f400062c062c2babec..680f31a13719fac7c889b86ca9aee4d2bcdce75c 100644 (file)
--- a/main.go
+++ b/main.go
@@ -1,6 +1,8 @@
 package main
 
 import (
+       "fmt"
+
        "git.vexingworkshop.com/signal9/dead-tooter/pkg/mastodon"
 )
 
@@ -28,5 +30,10 @@ func main() {
                panic(err.Error())
        }
 
-       account.VerifyCredentials(token)
+       err = account.VerifyCredentials(token)
+       if err != nil {
+               panic(err.Error())
+       }
+
+       fmt.Printf("%+v\n", token)
 }
index 96da9d9d133b8e9d9a67492d504b750ddf127578..b651b1b814e96eecfb116a84fea97a6a820134c5 100644 (file)
@@ -85,6 +85,7 @@ func (a *Account) Authorize(app Application) (code string) {
 func (a *Account) RequestToken(app Application, code string) (token Token, err error) {
        v := url.Values{}
        v.Set("client_id", app.ClientID)
+       v.Set("client_secret", app.ClientSecret)
        v.Set("code", code)
        v.Set("redirect_uri", app.RedirectURI)
        v.Set("grant_type", "authorization_code")