Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Expose Web3Auth user info #185

Merged
merged 2 commits into from
Oct 21, 2023
Merged

✨ Expose Web3Auth user info #185

merged 2 commits into from
Oct 21, 2023

Conversation

GabrielePicco
Copy link
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