# Issue with social login modal (new user) when /login is opened programmatically in an iframe

**URL:** <https://meta.discourse.org/t/issue-with-social-login-modal-new-user-when-login-is-opened-programmatically-in-an-iframe/138967>\
**Category:** Product Support\
**Created:** [January 17, 2020, 6:05pm UTC](https://meta.discourse.org/t/issue-with-social-login-modal-new-user-when-login-is-opened-programmatically-in-an-iframe/138967 "2020-01-17T18:05:25Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [January 21, 2020, 2:12pm UTC](https://meta.discourse.org/t/issue-with-social-login-modal-new-user-when-login-is-opened-programmatically-in-an-iframe/138967/6 "2020-01-21T14:12:29Z")

</div>

I’m not embedding Discourse in a iframe. I’m using the API to show a topic messages.

I’m not trying to login/signup _inside_ an iframe because social websites doesn’t allow to be displayed inside them.That’s why, when user clicks on a button inside the iframe, it opens a new browser tab to /login page on Discourse.

Technically, when user hits the login button, a new tab is opened with `/session/sso_provider`. `return_sso_url` will contain an url to backend to process the data, save the user’s session infos then responding some HTML to auto-close the window. The app then will detect it’s done and will be reloaded automatically so it can use the saved user’s session.

Even if the app was not in a iframe, It would likely happen the same. Since it’s a browser extension, you have no choice to open a new tab anyway. I’m wondering there are better ways to login/signup in this case.

EDIT: Here a demo (was not meant to public, but well, that the shortest way to show the issue and I feel like I don’t explain well enough) :  
_snip, video removed, no one care anyway_  
EDIT2: Seems to happen only when using the API `/session/sso_provider` ; if I do open Discourse url directly (still from an iframe), it seems the issue doesn’t happen.

---

_[View the full topic](https://meta.discourse.org/t/issue-with-social-login-modal-new-user-when-login-is-opened-programmatically-in-an-iframe/138967)._
