Skip to main content
When using Mocha, some users are unable to login using the preview. The symptoms they experience are:
  1. They successfully go through the login with Google flow
  2. When they return back to Mocha, they are not logged in and are typically presented with the login screen again
While this type of scenario can happen for a few reasons, here we document one reason which the AI cannot help with.

The problem

Mocha’s authentication service uses cookies when logging in users. The preview where you interact with the app you’re developing is considered a ‘third party’ by browsers. Browsers block cookies in third-party contexts like the preview for some users. If the cookie is blocked by the browser then it will not be set. If this happens, the app will not consider the user logged in. To determine if this is happening to you, the browser will display a warning informing you third-party cookies have been blocked. For example, in Google Chrome, there is an eye with a slash through it indicating this issue in the URL bar: Url bar blocking third-party cookies

Published apps

NOTE: this does NOT affect your app once published. This only affects logins in the preview as the preview is considered a “third-party” context.

The solution

To fix this problem, you’ll need to enable third-party cookies. In Chrome, click on the eye shown in the screen shot above. Third-party cookie blocked Then, toggle the switch next to “Third-party cookies” Third-party cookie blocked Refresh the page and try again. If third-party cookies were indeed the problem, then your app will now be working.