@@ -44,15 +44,23 @@ export default class Session extends EventEmitter {
4444 // TODO: move loginFunction to StreamrClient constructor where "auth type" is checked
4545 if ( typeof this . options . privateKey !== 'undefined' ) {
4646 const wallet = new Wallet ( this . options . privateKey )
47- this . loginFunction = async ( ) => this . _client . loginEndpoints . loginWithChallengeResponse ( ( d : string ) => wallet . signMessage ( d ) , wallet . address )
47+ this . loginFunction = async ( ) => (
48+ this . _client . loginEndpoints . loginWithChallengeResponse ( ( d : string ) => wallet . signMessage ( d ) , wallet . address )
49+ )
4850 } else if ( typeof this . options . ethereum !== 'undefined' ) {
4951 const provider = new Web3Provider ( this . options . ethereum )
5052 const signer = provider . getSigner ( )
51- this . loginFunction = async ( ) => this . _client . loginEndpoints . loginWithChallengeResponse ( ( d : string ) => signer . signMessage ( d ) , await signer . getAddress ( ) )
53+ this . loginFunction = async ( ) => (
54+ this . _client . loginEndpoints . loginWithChallengeResponse ( ( d : string ) => signer . signMessage ( d ) , await signer . getAddress ( ) )
55+ )
5256 } else if ( typeof this . options . apiKey !== 'undefined' ) {
53- this . loginFunction = async ( ) => this . _client . loginEndpoints . loginWithApiKey ( this . options . apiKey ! )
57+ this . loginFunction = async ( ) => (
58+ this . _client . loginEndpoints . loginWithApiKey ( this . options . apiKey ! )
59+ )
5460 } else if ( typeof this . options . username !== 'undefined' && typeof this . options . password !== 'undefined' ) {
55- this . loginFunction = async ( ) => this . _client . loginEndpoints . loginWithUsernamePassword ( this . options . username ! , this . options . password ! )
61+ this . loginFunction = async ( ) => (
62+ this . _client . loginEndpoints . loginWithUsernamePassword ( this . options . username ! , this . options . password ! )
63+ )
5664 } else {
5765 if ( ! this . options . sessionToken ) {
5866 this . options . unauthenticated = true
0 commit comments