Skip to content

Commit 4914f4d

Browse files
committed
feat: able to disable wallet modal
1 parent 119de26 commit 4914f4d

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ EAUTH_SESSION_TIMEOUT=60000
1515
EAUTH_SECRET=YOUR_SECRET_HERE
1616

1717
# component configs
18+
# Show wallet selection or injected only
19+
EAUTH_WALLETMODAL=true
1820
# isValidSignature feature for ERC-1271
1921
EAUTH_COMPONENTS_CONTRACT=true
2022
# ENS feature for OAuth and contract wallet

public/scripts/contractlogin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const Web3Modal = window.Web3Modal.default
2-
const WalletConnectProvider = window.WalletConnectProvider.default
2+
const WalletConnectProvider = window.WalletConnectProvider?.default
33
const Eauth = window.Eauth.default
44
const {
55
Fortmatic, Torus, Authereum, Portis,
@@ -22,7 +22,7 @@ class LoginApp {
2222
}
2323

2424
init() {
25-
const providerOptions = {
25+
const providerOptions = window.showWalletModal === 'false' ? {} : {
2626
walletconnect: {
2727
package: WalletConnectProvider,
2828
options: {

public/scripts/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LoginApp {
1919
}
2020

2121
init() {
22-
const providerOptions = {
22+
const providerOptions = window.showWalletModal === 'false' ? {} : {
2323
walletconnect: {
2424
package: WalletConnectProvider,
2525
options: {

views/layout.pug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ html
2121
block content
2222
a(href='https://pelith.com').powered-by-text Powered by Pelith
2323

24+
script.
25+
window.showWalletModal = `#{process.env.EAUTH_WALLETMODAL}`
2426
script(src='/scripts/lib/jquery-3.3.1.min.js')
2527
script(src='/scripts/lib/bootstrap.min.js')
2628
script(src='/scripts/web3.js')

0 commit comments

Comments
 (0)