// try to refresh the access token, no pop-up
this.session = await this.collapsedSessionRefresh(options.scopes);
return this.session;
} catch {
// If the refresh attempt fails we assume we don't have a session, so continue to create one.
}
this.currentSession = await this.connector.createSession() // opens pop-up
```
The situation happens when `this.collapsedSessionRefresh(options.scopes)` fails.
If user clicks on a link that loads this page, then pop-up opens successfully, but if user reloads the page, then browser blocks the popup.
What is also interesting is that if I put a breakpoint on `this.collapsedSessionRefresh(options.scopes)` then browser blocks the popup even if user clicks on the link. So debugger
breakpoint also seem to affect whether the browser blocks the pop-up.
I would like to know the logic why and when browser blocks the popup, so that I could design my application the right way. From what I understand so far, for the code above, in situation when `this.collapsedSessionRefresh(options.scopes)` fails, browser should always block the popup, because browser executes everything after `await` asynchronously. Yet, in practice, browser allows the popup, but only when user actively clicks on the link that leads to the page.
Please advise,
Gasan.