66 Button ,
77 ScrollView ,
88 Dimensions ,
9+ TextInput ,
910} from 'react-native' ;
1011import * as WebBrowser from '@toruslabs/react-native-web-browser' ;
1112import EncryptedStorage from 'react-native-encrypted-storage' ;
@@ -16,7 +17,7 @@ import Web3Auth, {
1617} from '@web3auth/react-native-sdk' ;
1718import RPC from './ethersRPC' ; // for using ethers.js
1819
19- const scheme = 'web3authrnbareaggregateexample ' ; // Or your desired app redirection scheme
20+ const scheme = 'web3authrnbareexample ' ; // Or your desired app redirection scheme
2021const resolvedRedirectUrl = `${ scheme } ://openlogin` ;
2122const clientId =
2223 'BHr_dKcxC0ecKn_2dZQmQeNdjPgWykMkcodEHkVvPMo71qzOV6SgtoN8KCvFdLN7bf34JOm89vWQMLFmSfIo84A' ;
@@ -26,6 +27,7 @@ export default function App() {
2627 const [ key , setKey ] = useState < string | undefined > ( '' ) ;
2728 const [ console , setConsole ] = useState < string > ( '' ) ;
2829 const [ web3auth , setWeb3Auth ] = useState < IWeb3Auth | null > ( null ) ;
30+ const [ email , setEmail ] = React . useState ( '[email protected] ' ) ; 2931
3032 const login = async ( ) => {
3133 try {
@@ -41,7 +43,7 @@ export default function App() {
4143 mfaLevel : 'default' ,
4244 curve : 'secp256k1' ,
4345 extraLoginOptions : {
44- 46+ login_hint : email ,
4547 connection : 'email' ,
4648 } ,
4749 } ) ;
@@ -52,7 +54,7 @@ export default function App() {
5254 uiConsole ( 'Logged In' ) ;
5355 }
5456 } catch ( e : unknown ) {
55- window . console . log ( e , e . stack ) ;
57+ window . console . log ( e , ( e as Error ) . stack ) ;
5658 setConsole ( ( e as Error ) . message ) ;
5759 }
5860 } ;
@@ -138,7 +140,7 @@ export default function App() {
138140 uiConsole ( message ) ;
139141 } ;
140142
141- const uiConsole = ( ...args ) => {
143+ const uiConsole = ( ...args : unknown [ ] ) => {
142144 setConsole ( JSON . stringify ( args || { } , null , 2 ) + '\n\n\n\n' + console ) ;
143145 } ;
144146
@@ -157,6 +159,13 @@ export default function App() {
157159
158160 const unloggedInView = (
159161 < View style = { styles . buttonArea } >
162+ < TextInput
163+ editable
164+ onChangeText = { text => setEmail ( text ) }
165+ value = { email }
166+ // eslint-disable-next-line react-native/no-inline-styles
167+ style = { { padding : 10 } }
168+ />
160169 < Button title = "Login with Web3Auth" onPress = { login } />
161170 </ View >
162171 ) ;
0 commit comments