We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b66f75 commit d299d85Copy full SHA for d299d85
frontend/src/utils/AuthService.ts
@@ -201,11 +201,15 @@ export default class AuthService {
201
"message",
202
({ data }: MessageEvent<AuthEventDetail>) => {
203
if (data.name === "requesting_auth") {
204
- // A new tab/window opened and is requesting shared auth
205
- AuthService.broadcastChannel.postMessage({
206
- name: "responding_auth",
207
- auth: AuthService.getCurrentTabAuth(),
208
- } as AuthResponseEventDetail);
+ const auth = AuthService.getCurrentTabAuth();
+
+ if (auth) {
+ // A new tab/window opened and is requesting shared auth
+ AuthService.broadcastChannel.postMessage({
209
+ name: "responding_auth",
210
+ auth: AuthService.getCurrentTabAuth(),
211
+ } as AuthResponseEventDetail);
212
+ }
213
}
214
},
215
);
0 commit comments