You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently struggling to integrate reCAPTCHA v3 Enterprise with FastAPI-users.
My frontend is already sending the proper token in the FormData sent to the FastAPI backend, I also already have the logic implemented on the backend to check said token with the library google-cloud-recaptcha-enterprise, but I spent hours trying to inject my dependency to the routes generated by fastapi_users.get_auth_router(auth_backend), fastapi_users.get_register_router(UserRead, UserCreate) and others.
Since the routes are statically created, it's already too late to try to add the Depends after calling the get_*_router methods.
Currently, to make it work, I copy/pasted the code for each /login, /register, /forgot-password routes to inject my dependency, but that's dirty, prone to errors and not maintainable.
Did I miss something, either in fastapi-users or more generally on FastAPI ? Or is it something not possible in the current implementation of fastapi-users ? If so, is it possible to implement that feature ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently struggling to integrate reCAPTCHA v3 Enterprise with FastAPI-users.
My frontend is already sending the proper token in the FormData sent to the FastAPI backend, I also already have the logic implemented on the backend to check said token with the library
google-cloud-recaptcha-enterprise
, but I spent hours trying to inject my dependency to the routes generated byfastapi_users.get_auth_router(auth_backend)
,fastapi_users.get_register_router(UserRead, UserCreate)
and others.Since the routes are statically created, it's already too late to try to add the
Depends
after calling theget_*_router
methods.Currently, to make it work, I copy/pasted the code for each
/login
,/register
,/forgot-password
routes to inject my dependency, but that's dirty, prone to errors and not maintainable.Did I miss something, either in fastapi-users or more generally on FastAPI ? Or is it something not possible in the current implementation of fastapi-users ? If so, is it possible to implement that feature ?
Beta Was this translation helpful? Give feedback.
All reactions