tangled
alpha
login
or
join now
danabra.mov
/
sidetrail
49
fork
atom
an app to share curated trails
sidetrail.app
atproto
nextjs
react
rsc
49
fork
atom
overview
issues
pulls
pipelines
add more logging
danabra.mov
3 months ago
61cfa9f2
b98f64b2
+5
-2
1 changed file
expand all
collapse all
unified
split
data
lex-client.ts
+5
-2
data/lex-client.ts
···
44
oauthSession = await oauthClient.restore(session.did);
45
} catch (err) {
46
if (err instanceof TokenRefreshError) {
47
-
// Session was deleted or token refresh failed - clear stale cookie and refresh UI
48
-
console.log(`[auth] Clearing stale session for ${session.did}: ${err.message}`);
49
session.destroy();
50
refresh();
0
0
0
51
}
52
throw err;
53
}
···
44
oauthSession = await oauthClient.restore(session.did);
45
} catch (err) {
46
if (err instanceof TokenRefreshError) {
47
+
const cause = err.cause instanceof Error ? err.cause.message : err.cause;
48
+
console.log(`[auth] TokenRefreshError ${session.did}: ${err.message} (cause: ${cause})`);
49
session.destroy();
50
refresh();
51
+
} else {
52
+
const msg = err instanceof Error ? err.message : err;
53
+
console.log(`[auth] restore failed ${session.did}: ${msg}`);
54
}
55
throw err;
56
}