# Login screen on mobile appears to be blank

**URL:** <https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [August 5, 2018, 9:18pm UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153 "2018-08-05T21:18:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_dima](https://avatars.discourse-cdn.com/v4/letter/_/c37758/32.png) [@\_dima](https://forum.wixstudio.com/u/_dima)\
**Post date:** [August 5, 2018, 9:18pm UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/1 "2018-08-05T21:18:33Z")

</div>

Hi Wix team,

In some of site pages, I need to check if user already was logged in.  
If user is not logged in, I want to show them “Login screen”.  
I write something like that to do so:

$w.onReady( function () {  
if (!users.currentUser.loggedIn) {  
console.log(“User is required to log-in”);  
$w(“#button1”).label = “Log in”;  
**return** users.promptLogin()  
.then( (res) =\> {  
console.log(“Sucessfully logged in”);  
})  
. catch ( (err) =\> {  
console.log(“Closed login screen”);  
});  
}  
$w(“#button1”).label = “Log out”;  
console.log(“User already logged in”);  
});

On desktop, the login screen is shown as expected, while on mobile I see only blank screen with close “X” at right upper corner.  
Is there some known issue related to mobile login?  
Test page for reference: [https://dmitrybi32.wixsite.com/issue-reproduce/about](https://dmitrybi32.wixsite.com/issue-reproduce/about)

Thanks.

---

<div class="post-metadata">

**Author:** ![\_tal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_tal/32/669_2.png) [@\_tal](https://forum.wixstudio.com/u/_tal)\
**Post date:** [August 8, 2018, 11:22am UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/2 "2018-08-08T11:22:39Z")

</div>

Hi,  
I recommend following [this article](https://support.wix.com/en/article/how-to-build-your-own-members-area-using-code) which explains how to create a login page.

Best,  
Tal.

---

<div class="post-metadata">

**Author:** ![\_dima](https://avatars.discourse-cdn.com/v4/letter/_/c37758/32.png) [@\_dima](https://forum.wixstudio.com/u/_dima)\
**Post date:** [August 25, 2018, 11:26am UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/3 "2018-08-25T11:26:21Z")

</div>

Hi Tal,

I checked out the article, the difference I find is that **wixUsers.promptLogin** is called there without “return”.

```javascript
// prompt the user to log in      
wixUsers.promptLogin( {"mode": "login"} )       
.then( (user) => { 
...

```

Indeed if I remove “return” before login prompt function, login screen displayed on mobile as expected.

However it exposes undesired effect - the page is shown for some time before actual login screen appears.  
In older forum discussion, Yoav wrote the following note:  
“Note that in both cases we make sure to return the promises from the $w.onReady function. This makes sure we complete the processing before the page is displayed to the user.” ([https://www.wix.com/code/home/forum/community-discussion/wix-users-api](https://www.wix.com/code/home/forum/community-discussion/wix-users-api))

This is the reason why I need the wixUsers.promptLogin to be called like  
return wixUsers.promptLogin(…)

And here I’m back to the original issue - with “return” before promptLogin , on mobile, login page appears blank…

Thanks,  
Dima

---

<div class="post-metadata">

**Author:** ![admin-23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/admin-23/32/708_2.png) [@admin-23](https://forum.wixstudio.com/u/admin-23)\
**Post date:** [September 25, 2018, 2:20pm UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/4 "2018-09-25T14:20:52Z")

</div>

Hi Dima,

We discovired a few anomalies when triggering the login prompt in mobile.  
I will update this thread once we have feedback regarding the mater.

In the meanwhile as a workaround you can set the page as [member only](https://support.wix.com/en/article/creating-members-only-pages-596999) , which will trigger the login prompt automatically. This way you can be sure that wixUsers.currentUser.loggedIn will always return true.

---

<div class="post-metadata">

**Author:** ![\_dima](https://avatars.discourse-cdn.com/v4/letter/_/c37758/32.png) [@\_dima](https://forum.wixstudio.com/u/_dima)\
**Post date:** [September 26, 2018, 7:05pm UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/5 "2018-09-26T19:05:28Z")

</div>

Hi Ido,

Thanks for the update regarding your findings.

Regarding w/a, indeed it is possible to configure all the pages I need as member only.  
However in this case AFAIK I’m not able to change login screen language according to current user language, as I do it with wixUsers.promptLogin.  
As well, right now I trigger the login from ‘site’ code, for specific pages, having some logic dependent on successful login.  
So the bottom line, I would prefer to wait for the fix from WIX side.

Thanks,  
Dima

---

<div class="post-metadata">

**Author:** ![\_dima](https://avatars.discourse-cdn.com/v4/letter/_/c37758/32.png) [@\_dima](https://forum.wixstudio.com/u/_dima)\
**Post date:** [October 15, 2018, 7:07pm UTC](https://forum.wixstudio.com/t/login-screen-on-mobile-appears-to-be-blank/3153/6 "2018-10-15T19:07:52Z")

</div>

Hi Ido,  
Is there any update on this issue?  
Thanks,  
Dima
