forked from supabase/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add turnstile support (supabase#1094)
## Overview Captcha providers are treated as generic in this PR. Users can swap out the provider which in turn swaps out only the `siteverify` URL. This approach generally works fine when considering `turnstile` and `hcaptcha` since both have similar feature sets. However, for other providers like `recaptcha` users might want to use specialized features such as Android recaptcha and recaptcha V3 score. Since the [responses slightly differ between an android response and a generic response](https://developers.google.com/recaptcha/docs/verify), we may need to introduce separate structs. Another alternative considered was to initialize a new provider type for each methods (similar to `SMSProvider`) and have corresponding `verifyCaptcha` methods for each provider. This way there is clear separation of decoding logic for response types for each provider but there will be slightly more code to maintain. ### TODOs: - [x] Manual testing with FE components After PR: - Update dashboard to reflect additional provider - Update [hcaptcha docs](https://supabase.com/docs/guides/auth/auth-captcha) --------- Co-authored-by: joel@joellee.org <joel@joellee.org>
- Loading branch information
Showing
5 changed files
with
73 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters