Skip to content
CCPEDIAby Unity Nodes
App Development

DamlHubLogin callback value undefined for withButton

3 posts171 viewsLast activity Apr 2022

  1. MaxOP

    Currently I only receive the credential object when I sign in withToken,

    <DamlHubLogin withToken withButton onLogin={(credential, error) => {
                  console.log(credential)
                 
                  if(credential){
                    login({token: credential.token, ledgerId: credential.ledgerId, party: credential.party})
                  }
     }}/>
    

    I don’t receive anything if I sign in with button though, nothing logs, is that intended?

  2. Alex_Matson

    Hi @Max ,

    Do you get anything when you log the error object?

  3. Max

    When I login with JWT, everything logs
    Screenshot 2022-04-08 at 8.42.07 AM

    When I login withButton,
    it seems onLogin isn’t even called as I don’t see any logs

    <DamlHubLogin withToken withButton onLogin={(credential, error) => {
                  console.log('logincallback', 'credential',credential, 'error', error)
                  if(error){
                    console.log(error)
                  }
                 
                  if(credential){
                    login({token: credential.token, ledgerId: credential.ledgerId, party: credential.party})
                  }
                }}/>