meta options
This commit is contained in:
parent
4697dab339
commit
8726c931fa
21 changed files with 3028 additions and 3 deletions
|
|
@ -37,7 +37,11 @@ class Settings(BaseSettings):
|
|||
whatsapp_phone_number_id: str = ""
|
||||
whatsapp_business_account_id: str = ""
|
||||
meta_app_id: str = ""
|
||||
meta_app_secret: str = ""
|
||||
meta_embedded_signup_config_id: str = ""
|
||||
# Facebook Login for Business configuration. Do not reuse the WhatsApp Embedded Signup config.
|
||||
meta_login_config_id: str = ""
|
||||
meta_oauth_redirect_uri: str = ""
|
||||
whatsapp_business_phone: str = "919411257916"
|
||||
# Public HTTPS base for webhook callback (no trailing slash), e.g. https://urmiai.com
|
||||
public_api_base_url: str = ""
|
||||
|
|
@ -57,6 +61,26 @@ class Settings(BaseSettings):
|
|||
return [self.frontend_origin]
|
||||
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
def meta_graph_app_secret(self) -> str:
|
||||
return self.meta_app_secret or self.whatsapp_app_secret
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
def meta_oauth_redirect_uri_resolved(self) -> str:
|
||||
if self.meta_oauth_redirect_uri.strip():
|
||||
return self.meta_oauth_redirect_uri.strip()
|
||||
base = self.public_api_base_url.rstrip("/") if self.public_api_base_url else ""
|
||||
if base:
|
||||
return f"{base}/api/v1/meta/oauth/callback"
|
||||
return "http://localhost:8000/api/v1/meta/oauth/callback"
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
def meta_oauth_configured(self) -> bool:
|
||||
return bool(self.meta_app_id and self.meta_graph_app_secret)
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
def whatsapp_webhook_url(self) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue