Bluesky app fork with some witchin' additions 💫

Track rotated auth tokens

+16 -1
+2
src/state/index.ts
··· 34 34 if (!api.sessionManager.session && rootStore.session.isAuthed) { 35 35 // reset session 36 36 rootStore.session.clear() 37 + } else if (api.sessionManager.session) { 38 + rootStore.session.updateAuthTokens(api.sessionManager.session) 37 39 } 38 40 }) 39 41
+14 -1
src/state/models/session.ts
··· 1 1 import {makeAutoObservable} from 'mobx' 2 2 import {sessionClient as AtpApi} from '../../third-party/api/index' 3 - import type {SessionServiceClient} from '../../third-party/api/src/index' 3 + import type { 4 + SessionServiceClient, 5 + Session, 6 + } from '../../third-party/api/src/index' 4 7 import type * as GetAccountsConfig from '../../third-party/api/src/client/types/com/atproto/server/getAccountsConfig' 5 8 import {isObj, hasProp} from '../lib/type-guards' 6 9 import {RootStoreModel} from './root-store' ··· 86 89 87 90 setState(data: SessionData) { 88 91 this.data = data 92 + } 93 + 94 + updateAuthTokens(session: Session) { 95 + if (this.data) { 96 + this.setState({ 97 + ...this.data, 98 + accessJwt: session.accessJwt, 99 + refreshJwt: session.refreshJwt, 100 + }) 101 + } 89 102 } 90 103 91 104 private configureApi(): boolean {