This commit is contained in:
parent
aa8932ea38
commit
e041d00226
1 changed files with 7 additions and 1 deletions
|
@ -118,8 +118,14 @@ func (bluesky *Bluesky) RefreshSession() error {
|
|||
func (bluesky *Bluesky) CheckSessionValid() {
|
||||
resp := new(BSkySessionResponse)
|
||||
|
||||
params := struct {
|
||||
Actor string `url:"actor"`
|
||||
}{
|
||||
Actor: bluesky.Cfg.Handle,
|
||||
}
|
||||
|
||||
bluesky.sling.New().Set("Authorization", fmt.Sprintf("Bearer %s", bluesky.Cfg.AccessJWT)).
|
||||
Get("/xrpc/app.bsky.actor.getProfile").Receive(resp, resp)
|
||||
Get("/xrpc/app.bsky.actor.getProfile").QueryStruct(params).Receive(resp, resp)
|
||||
if resp.Error == "ExpiredToken" {
|
||||
bluesky.RefreshSession()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue