Skip to content

Commit

Permalink
refresh bsky token
Browse files Browse the repository at this point in the history
  • Loading branch information
amay077 committed May 11, 2024
1 parent 7fc8f09 commit 5228c37
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/MainContent.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
import MastodonConnection from "./MastodonConnection.svelte";
import { BskyAgent, RichText } from "@atproto/api";
import { BskyAgent, RichText, type AtpSessionData } from "@atproto/api";
import BlueSkyConnection from "./BlueSkyConnection.svelte";
import { loadPostSetting, savePostSetting, type SettingDataBluesky, type SettingDataMastodon, type SettingDataTwitter, type SettingType } from "./func";
import TwitterConnection from "./TwitterConnection.svelte";
Expand Down Expand Up @@ -203,7 +203,15 @@
});
// resume session
await agent.resumeSession(postSettings.bluesky?.data?.sessionData!);
const res = await agent.resumeSession(postSettings.bluesky?.data?.sessionData!);
// refresh tokens
await agent.refreshSession();
postSettings.bluesky = { type: 'bluesky', title: 'BlueSky', enabled: true, data: { sessionData: agent.session as AtpSessionData } };
savePostSetting(postSettings.bluesky);
// creating richtext
const rt = new RichText({
Expand Down

0 comments on commit 5228c37

Please sign in to comment.