# \[Archive\] Re-using Web3Auth Provider without Login Modal

**URL:** <https://builder.metamask.io/t/archive-re-using-web3auth-provider-without-login-modal/1405>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [May 6, 2024, 2:12am UTC](https://builder.metamask.io/t/archive-re-using-web3auth-provider-without-login-modal/1405 "2024-05-06T02:12:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarun](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@tarun](https://builder.metamask.io/u/tarun)\
**Post date:** [May 6, 2024, 2:12am UTC](https://builder.metamask.io/t/archive-re-using-web3auth-provider-without-login-modal/1405/1 "2024-05-06T02:12:18Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **tarun** on 5/6/2024.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

- **SDK Version** (package.json):“^7.3.2”
- **Platform** : Web(Desktop)  
this is the piece of code i am using

```auto
const web3auth = new Web3Auth({
  clientId: WEB_3_AUTH_CLIENT_ID,
  chainConfig: {
    chainId: numberToHex(CHAIN_ID),
    chainNamespace: "eip155",
    rpcTarget: "https://rpc-amoy.polygon.technology",
  },
  uiConfig: {
    dark: true,
  },
  web3AuthNetwork: web3AuthNetwork[CHAIN_ID],
});
await web3auth.initModal({
modalConfig: {
[WALLET_ADAPTERS.OPENLOGIN]: allowedSocialMethods,
},
});

```

Before, the code used to directly access the `provider` object if a user was already logged in, skipping the login modal. Now, it’s consistently prompting the login modal regardless of the user’s login status.

My goal is to avoid this repetition and obtain the `provider` object on subsequent pages without showing the login modal for already logged-in users.  
How do i achieve this?  
(PS:I can’t store web3auth instance in frontend cause it is sensitive information)

---

<div class="post-metadata">

**Author:** ![TomTom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@TomTom](https://builder.metamask.io/u/TomTom)\
**Post date:** [May 6, 2024, 5:06pm UTC](https://builder.metamask.io/t/archive-re-using-web3auth-provider-without-login-modal/1405/2 "2024-05-06T17:06:07Z")

</div>

hi @tarun

I hope you are doing well ?

Did you check our EVM PnP SDK example ?  
I’m sure this example will help you to achieve what you are planning to do.

 ![](https://github.githubassets.com/favicons/favicon.svg)

```
  <a href="https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-modal-sdk/blockchain-connection-examples/evm-modal-example" target="_blank" rel="noopener">github.com</a>

```

### [web3auth-pnp-examples/web-modal-sdk/blockchain-connection-examples/evm-modal-exa...](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-modal-sdk/blockchain-connection-examples/evm-modal-example)

Contribute to Web3Auth/web3auth-pnp-examples development by creating an account on GitHub.

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/89de3d5ae8958c55ec3d0646b5e41acc0935806f.png)

```
  <a href="https://evm-no-modal-example.vercel.app/" target="_blank" rel="noopener">evm-no-modal-example.vercel.app</a>

```

### [React App](https://evm-no-modal-example.vercel.app/)

Web site created using create-react-app

Don’t hesitate to get in touch with me if you continue with the issue.
