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' ;
@@ -17,7 +18,7 @@ import Web3Auth, {
1718} from '@web3auth/react-native-sdk' ;
1819import RPC from './ethersRPC' ; // for using ethers.js
1920
20- const scheme = 'web3authrnbareaggregateexample ' ; // Or your desired app redirection scheme
21+ const scheme = 'web3authrnbareexample ' ; // Or your desired app redirection scheme
2122const resolvedRedirectUrl = `${ scheme } ://openlogin` ;
2223const clientId =
2324 'BHr_dKcxC0ecKn_2dZQmQeNdjPgWykMkcodEHkVvPMo71qzOV6SgtoN8KCvFdLN7bf34JOm89vWQMLFmSfIo84A' ;
@@ -27,6 +28,7 @@ export default function App() {
2728 const [ key , setKey ] = useState < string | undefined > ( '' ) ;
2829 const [ console , setConsole ] = useState < string > ( '' ) ;
2930 const [ web3auth , setWeb3Auth ] = useState < IWeb3Auth | null > ( null ) ;
31+ const [ email , setEmail ] = React . useState ( '[email protected] ' ) ; 3032
3133 const login = async ( ) => {
3234 try {
@@ -42,7 +44,7 @@ export default function App() {
4244 mfaLevel : 'default' ,
4345 curve : 'secp256k1' ,
4446 extraLoginOptions : {
45- 47+ login_hint : email ,
4648 connection : 'email' ,
4749 } ,
4850 } ) ;
@@ -52,7 +54,7 @@ export default function App() {
5254 setKey ( web3auth . privKey ) ;
5355 uiConsole ( 'Logged In' ) ;
5456 }
55- } catch ( e ) {
57+ } catch ( e : any ) {
5658 setConsole ( e . message ) ;
5759 }
5860 } ;
@@ -136,7 +138,7 @@ export default function App() {
136138 uiConsole ( message ) ;
137139 } ;
138140
139- const uiConsole = ( ...args ) => {
141+ const uiConsole = ( ...args : unknown [ ] ) => {
140142 setConsole ( JSON . stringify ( args || { } , null , 2 ) + '\n\n\n\n' + console ) ;
141143 } ;
142144
@@ -155,6 +157,13 @@ export default function App() {
155157
156158 const unloggedInView = (
157159 < View style = { styles . buttonArea } >
160+ < TextInput
161+ editable
162+ onChangeText = { text => setEmail ( text ) }
163+ value = { email }
164+ // eslint-disable-next-line react-native/no-inline-styles
165+ style = { { padding : 10 } }
166+ />
158167 < Button title = "Login with Web3Auth" onPress = { login } />
159168 </ View >
160169 ) ;
0 commit comments