Skip to main content
100%

Gist ded211d191b8c30e15169e310f084c40

✓ Published0🌍 Public
Aackuser
Last edited Jul 14, 2022
Created on Jul 14, 2022

This example shows a login form for a web3 application that authenticates users with either a seed phrase and password or a MetaMask wallet. The form uses Angular’s `FormBuilder` and `FormControl` to manage validation, including a custom `forbiddenSeedsValidator` that checks seed validity through a `Web3Service`. When a user has previously stored encrypted seeds, the password field’s `valueChanges` observable, combined with `withLatestFrom` on status changes, decrypts the seeds and populates the seeds input. The code also toggles a logout state and calls `loginMetamask` for wallet-based entry.

AI-generated description

Similar vizzes