Add LinkedIn OAuth connect with portal-saved app credentials.
Deploy Beta / unit-tests (push) Successful in 12s
Deploy Beta / docker (push) Successful in 17s
Deploy Beta / deploy-beta (push) Successful in 1m41s

Replace manual token paste with Authorization Code flow; store Client ID/secret in the DB from the social accounts UI and surface a copyable callback URL for LinkedIn Auth setup.
This commit is contained in:
2026-08-11 07:52:10 -05:00
parent 2643ba7a96
commit 44d300271a
12 changed files with 517 additions and 26 deletions
+23
View File
@@ -10,6 +10,29 @@ class Platform(models.TextChoices):
LINKEDIN = "linkedin", "LinkedIn"
class SocialAppCredentials(UUIDPrimaryKeyModel, TimeStampedModel):
"""
Developer-app OAuth credentials entered in the portal (not env).
client_secret is Fernet-encrypted. One row per platform.
"""
platform = models.CharField(max_length=16, choices=Platform.choices, unique=True)
client_id = models.CharField(max_length=255, blank=True)
encrypted_client_secret = models.TextField(blank=True)
class Meta:
verbose_name_plural = "social app credentials"
ordering = ["platform"]
def __str__(self) -> str:
return f"{self.platform} app credentials"
@property
def is_configured(self) -> bool:
return bool(self.client_id and self.encrypted_client_secret)
class SocialAccount(UUIDPrimaryKeyModel, TimeStampedModel):
platform = models.CharField(max_length=16, choices=Platform.choices)
label = models.CharField(max_length=120)