# How to allow popup permission of web browser in mobile

**URL:** <https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663>\
**Category:** Get Help\
**Tags:** popup, auth0\
**Created:** [November 22, 2020, 2:21pm UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663 "2020-11-22T14:21:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.yang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david.yang/32/22931_2.png) [@david.yang](https://community.auth0.com/u/david.yang)\
**Post date:** [November 22, 2020, 2:21pm UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663/1 "2020-11-22T14:21:50Z")

</div>

I am using Auth0 loginwithpopup in my React app.  
Auth0 works well in all desktops, but when I try to login it says “Could not open popup” using mobile web browser.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/2/5/25824a18917b1b649a28f0e2c434769819c1e645.jpeg)  
How can I avoid this and allow the permission programmatically?

```
import React, {
  createContext,
  useEffect,
  useReducer
} from 'react';
import { Auth0Client } from '@auth0/auth0-spa-js';
import SplashScreen from 'src/components/SplashScreen';
import { auth0Config } from 'src/config';
import axios from 'axios';

let auth0Client = null;

const initialAuthState = {
  isAuthenticated: false,
  isInitialised: false,
  user: null,
  info: null
};

const AuthContext = createContext({
  ...initialAuthState,
  method: 'Auth0',
  loginWithPopup: () => Promise.resolve(),
  logout: () => { }
});

export const AuthProvider = ({ children }) => {
  const [state, dispatch] = useReducer(reducer, initialAuthState);
  const loginWithPopup = async (options) => {
    await auth0Client.loginWithPopup(options);
    const isAuthenticated = await auth0Client.isAuthenticated();

    if (isAuthenticated) {
      const user = await auth0Client.getUser();
      const claims = await auth0Client.getIdTokenClaims();
      
      dispatch({
        type: 'LOGIN',
        payload: {
          user: {
            id: user.sub,
            avatar: user.picture,
            email: user.email,
            name: user.name,
            tier: 'Premium'
          },
        }
      });
    }
  };

 ...

  useEffect(() => {
    const initialise = async () => {
      try {
        auth0Client = new Auth0Client({
          redirect_uri: `${window.location.origin}/verification`,
          cacheLocation: 'localstorage',
          ...auth0Config
        });
   ...

export default AuthContext;

```

---

<div class="post-metadata">

**Author:** ![david.yang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david.yang/32/22931_2.png) [@david.yang](https://community.auth0.com/u/david.yang)\
**Post date:** [November 24, 2020, 1:07am UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663/2 "2020-11-24T01:07:21Z")

</div>

Any help?  
How to get away from this?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Ale](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ale/32/50860_2.png) [@Ale](https://community.auth0.com/u/Ale)\
**Post date:** [March 14, 2021, 2:11am UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663/3 "2021-03-14T02:11:58Z")

</div>

Hey @david.yang, I don’t think this is possible due to security concerns. I’ve provided a similar response on [this other ticket](https://community.auth0.com/t/how-to-change-auth0-error-message/59351/4).

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 15, 2021, 8:20am UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663/4 "2021-03-15T08:20:32Z")

</div>

Thanks for sharing that @Ale !

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2021, 10:16am UTC](https://community.auth0.com/t/how-to-allow-popup-permission-of-web-browser-in-mobile/53663/5 "2021-03-25T10:16:41Z")

</div>


