tangled
alpha
login
or
join now
retr0.id
/
pdsls
forked from
pds.ls/pdsls
1
fork
atom
atproto explorer
1
fork
atom
overview
issues
pulls
pipelines
fix login signin state
handle.invalid
4 months ago
dba10696
c437950f
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+4
-2
1 changed file
expand all
collapse all
unified
split
src
components
login.tsx
+4
-2
src/components/login.tsx
···
115
115
const lastSignedIn = localStorage.getItem("lastSignedIn");
116
116
117
117
if (lastSignedIn) {
118
118
+
const sessions = localStorage.getItem("sessions");
119
119
+
const newSessions: Sessions = sessions ? JSON.parse(sessions) : {};
118
120
try {
119
121
const session = await getSession(lastSignedIn as Did);
120
122
const rpc = new Client({ handler: new OAuthUserAgent(session) });
121
123
const res = await rpc.get("com.atproto.server.getSession");
124
124
+
newSessions[lastSignedIn].signedIn = true;
125
125
+
localStorage.setItem("sessions", JSON.stringify(newSessions));
122
126
if (!res.ok) throw res.data.error;
123
127
return session;
124
128
} catch (err) {
125
125
-
const sessions = localStorage.getItem("sessions");
126
126
-
const newSessions: Sessions = sessions ? JSON.parse(sessions) : {};
127
129
newSessions[lastSignedIn].signedIn = false;
128
130
localStorage.setItem("sessions", JSON.stringify(newSessions));
129
131
throw err;