#155 — Add support of emails whitelisting to go public
Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned
Created: 2024-10-22 · Updated: 2025-09-15
Description
Caused by #89
@TwillPayments would provide emails list to set.
For @TwillPayments to see users which were rejected by white list of emails Table Editor → auth→users page may be a source.
AC:
- Add configuration option to specify list of emails allowed to create a tenant.
- Update POST /self-management/tenant (or
NoTenantGrantedFor) to allow only whitelisted users call it. For others sent some distinct error which may be handled on FrontEnd with calling https://supabase.com/docs/reference/javascript/auth-updateuser to set extra information intoauth.users.raw_user_meta_datain Supabase (may be found in Table Editor → auth→users page).
Implementation details.
After deploying to staging found issue in authentication flow - SupabaseService.get_user_from_request not populates with Supabase info “not in cache” users. Fixed in https://github.com/Twill-AI/facade/pull/183.
Next attempt to sign up with white-listed emails failed, POST https://staging.twillai.com/api/v1/self-management/tenant returned 500, logs:
2024-11-08T09:43:36.109156316Z File "/app/app/auth/auth.py", line 441, in get_current_user_without_tenant_and_alter_tenant_id
2024-11-08T09:43:36.109170752Z user = await DepsSingleton.get_auth_service().get_user_from_request(
2024-11-08T09:43:36.109176563Z ^^^
## Notes
_Add implementation notes, blockers, and context here_
## Related
_Add wikilinks to related people, meetings, or other tickets_