Skip to content

Commit

Permalink
feat: able to disable wallet modal
Browse files Browse the repository at this point in the history
  • Loading branch information
hung-pelith committed Oct 28, 2021
1 parent 119de26 commit 4914f4d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ EAUTH_SESSION_TIMEOUT=60000
EAUTH_SECRET=YOUR_SECRET_HERE

# component configs
# Show wallet selection or injected only
EAUTH_WALLETMODAL=true
# isValidSignature feature for ERC-1271
EAUTH_COMPONENTS_CONTRACT=true
# ENS feature for OAuth and contract wallet
Expand Down
4 changes: 2 additions & 2 deletions public/scripts/contractlogin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Web3Modal = window.Web3Modal.default
const WalletConnectProvider = window.WalletConnectProvider.default
const WalletConnectProvider = window.WalletConnectProvider?.default
const Eauth = window.Eauth.default
const {
Fortmatic, Torus, Authereum, Portis,
Expand All @@ -22,7 +22,7 @@ class LoginApp {
}

init() {
const providerOptions = {
const providerOptions = window.showWalletModal === 'false' ? {} : {
walletconnect: {
package: WalletConnectProvider,
options: {
Expand Down
2 changes: 1 addition & 1 deletion public/scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LoginApp {
}

init() {
const providerOptions = {
const providerOptions = window.showWalletModal === 'false' ? {} : {
walletconnect: {
package: WalletConnectProvider,
options: {
Expand Down
2 changes: 2 additions & 0 deletions views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ html
block content
a(href='https://pelith.com').powered-by-text Powered by Pelith

script.
window.showWalletModal = `#{process.env.EAUTH_WALLETMODAL}`
script(src='/scripts/lib/jquery-3.3.1.min.js')
script(src='/scripts/lib/bootstrap.min.js')
script(src='/scripts/web3.js')
Expand Down

0 comments on commit 4914f4d

Please sign in to comment.