Skip to content

Commit 74b9abb

Browse files
committed
#325 don't throw errors for temporary subjectless agent
1 parent 427b0e8 commit 74b9abb

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

data-browser/src/views/InvitePage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function InvitePage({ resource }: ResourcePageProps): JSX.Element {
6161
inviteURL.searchParams.set('agent', agentSubject!);
6262
}
6363

64+
// Will be a `Redirect`, see RedirectPage
6465
navigate(constructOpenURL(inviteURL.href));
6566
}
6667

lib/src/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ export class Store {
553553
public setAgent(agent: Agent | undefined): void {
554554
this.agent = agent;
555555

556-
if (agent) {
556+
if (agent && agent.subject) {
557557
setCookieAuthentication(this.serverUrl, agent);
558558

559559
this.webSockets.forEach(ws => {

lib/src/websockets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function parseResourceMessage(ev: MessageEvent): Resource[] {
6767
export async function authenticate(client: WebSocket, store: Store) {
6868
const agent = store.getAgent();
6969

70-
if (!agent) {
70+
if (!agent || !agent.subject) {
7171
return;
7272
}
7373

0 commit comments

Comments
 (0)