diff --git a/main.go b/main.go index 37d1188..3178e7d 100644 --- a/main.go +++ b/main.go @@ -15,10 +15,11 @@ import ( "github.com/kirsle/configdir" "github.com/mattn/go-mastodon" "github.com/k3a/html2text" - webview "github.com/webview/webview_go" + /*webview "github.com/webview/webview_go"*/ "encoding/json" "path/filepath" + "net/url" _ "net/http" "context" @@ -169,17 +170,27 @@ func ProfileLaunch() { app, err := mastodon.RegisterApp(context.Background(), AppConfig) if err != nil { dialog.ShowError(err, AddProfileWindow) + return } fmt.Println("App successfully created:\n", app) // Step two: the user now needs to log in + /* Webview := webview.New(false) defer Webview.Destroy() Webview.SetTitle("Authenticate - copy the authorisation code when logged in.") Webview.SetSize(480, 320, webview.HintNone) Webview.Navigate(app.AuthURI) Webview.Run() + */ + u, err := url.Parse(app.AuthURI) + if err != nil { + dialog.ShowError(err, AddProfileWindow) + return + } + + App.OpenURL(u) AddProfileWindow.Resize(fyne.NewSize(500, 500))