Fix auth
This commit is contained in:
parent
d4909eaad4
commit
84535cb5a7
1 changed files with 4 additions and 3 deletions
|
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
type BSky struct {
|
||||
Bluesky *Bluesky
|
||||
DID string
|
||||
}
|
||||
|
||||
func NewBSky() *BSky {
|
||||
|
|
@ -104,10 +105,10 @@ func (b *BSky) GetPDS(handle string) string {
|
|||
func (b *BSky) Auth(authData []string) error {
|
||||
b.Bluesky.Cfg.Handle = authData[0]
|
||||
b.getPDS()
|
||||
auth, err := loadAuth()
|
||||
if err != nil { // no auth session found
|
||||
auth, _ := loadAuth()
|
||||
if auth == nil || auth.AccessJWT == "" { // no auth session found
|
||||
b.Bluesky.Cfg.AppPassword = authData[1]
|
||||
err = b.Bluesky.CreateSession(b.Bluesky.Cfg)
|
||||
err := b.Bluesky.CreateSession(b.Bluesky.Cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to auth: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue