|
@@ -4,7 +4,7 @@ import (
|
|
|
"errors"
|
|
"errors"
|
|
|
"log/slog"
|
|
"log/slog"
|
|
|
|
|
|
|
|
- "github.com/ayn2op/discordo/internal/config"
|
|
|
|
|
|
|
+ "github.com/ayn2op/discordo/internal/consts"
|
|
|
"github.com/diamondburned/arikawa/v3/api"
|
|
"github.com/diamondburned/arikawa/v3/api"
|
|
|
"github.com/rivo/tview"
|
|
"github.com/rivo/tview"
|
|
|
"github.com/zalando/go-keyring"
|
|
"github.com/zalando/go-keyring"
|
|
@@ -47,7 +47,7 @@ func (self *Form) login() {
|
|
|
// Create an API client without an authentication token.
|
|
// Create an API client without an authentication token.
|
|
|
client := api.NewClient("")
|
|
client := api.NewClient("")
|
|
|
// Spoof the user agent of a web browser.
|
|
// Spoof the user agent of a web browser.
|
|
|
- client.UserAgent = config.UserAgent
|
|
|
|
|
|
|
+ client.UserAgent = consts.UserAgent
|
|
|
|
|
|
|
|
// Attempt to login using the email and password.
|
|
// Attempt to login using the email and password.
|
|
|
resp, err := client.Login(email, password)
|
|
resp, err := client.Login(email, password)
|
|
@@ -76,7 +76,7 @@ func (self *Form) login() {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- go keyring.Set(config.Name, "token", resp.Token)
|
|
|
|
|
|
|
+ go keyring.Set(consts.Name, "token", resp.Token)
|
|
|
|
|
|
|
|
if self.done != nil {
|
|
if self.done != nil {
|
|
|
self.done(resp.Token)
|
|
self.done(resp.Token)
|