clients
clients copied to clipboard
[BEEEP] [SM-225] Extract captcha into separate component
Type of change
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
Objective
Previously we extended a base component for captcha functionality. Inheritance in Angular components is tricky and something that should be avoided in most cases. An alternative pattern is decomposition.
This PR extracts the Captcha functionality into it's own component, and also merges the new captcha component. The parent component communicates with it by setting input and receiving outputs.
This properly encapsulates the captcha logic into it's own class without leaking any concerns.
Code changes
- apps/web/src/connectors/captcha.ts: Add support for reloading captcha
Before you submit
- Please add unit tests where it makes sense to do so (encouraged but not required)
- If this change requires a documentation update - notify the documentation team
- If this change has particular deployment requirements - notify the DevOps team
We could certainly hide the state depending on values. We probably also want a way to re-trigger the captcha right?