Skip to content

✨ Expose Web3Auth user info#185

Merged
GabrielePicco merged 2 commits intomainfrom
feat/save-web3auth-info
Oct 21, 2023
Merged

✨ Expose Web3Auth user info#185
GabrielePicco merged 2 commits intomainfrom
feat/save-web3auth-info

Conversation

@GabrielePicco
Copy link
Copy Markdown
Collaborator

Expose Web3Auth user info

Status Type ⚠️ Core Change Issue
Ready Feature No -

Problem

Web3Auth UserInfo were not exposed after the login

Solution

Added a public userInfo field that can be accessed after the login:

As a simple example, a script can register to the OnLogin event and print the user email, if available.

public void Start()
{
    Web3.OnLogin += OnLogin;
}

private void OnLogin(Account obj)
{
    if(Web3.Wallet is Web3AuthWallet) Debug.Log(((Web3AuthWallet)Web3.Wallet).userInfo?.email);
}

@GabrielePicco GabrielePicco merged commit f755a17 into main Oct 21, 2023
@GabrielePicco GabrielePicco deleted the feat/save-web3auth-info branch October 21, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant