support PixelFed (very long token)
This commit is contained in:
parent
82ec85b086
commit
4ec67e691f
2 changed files with 3 additions and 3 deletions
|
@ -291,7 +291,7 @@ def get_mastodon_login_url(app, login_domain, version, request):
|
|||
url = request.scheme + "://" + request.get_host() + reverse('users:OAuth2_login')
|
||||
if login_domain == TWITTER_DOMAIN:
|
||||
return f"https://twitter.com/i/oauth2/authorize?response_type=code&client_id={app.client_id}&redirect_uri={quote(url)}&scope={quote(settings.TWITTER_CLIENT_SCOPE)}&state=state&code_challenge=challenge&code_challenge_method=plain"
|
||||
scope = 'read' if 'Pixelfed' in version else settings.MASTODON_CLIENT_SCOPE
|
||||
scope = settings.MASTODON_LEGACY_CLIENT_SCOPE if 'Pixelfed' in version else settings.MASTODON_CLIENT_SCOPE
|
||||
return "https://" + login_domain + "/oauth/authorize?client_id=" + app.client_id + "&scope=" + quote(scope) + "&redirect_uri=" + url + "&response_type=code"
|
||||
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ class User(AbstractUser):
|
|||
mastodon_id = models.CharField(max_length=100, blank=False)
|
||||
# mastodon domain name, eg donotban.com
|
||||
mastodon_site = models.CharField(max_length=100, blank=False)
|
||||
mastodon_token = models.CharField(max_length=100, default='')
|
||||
mastodon_refresh_token = models.CharField(max_length=100, default='')
|
||||
mastodon_token = models.CharField(max_length=2048, default='')
|
||||
mastodon_refresh_token = models.CharField(max_length=2048, default='')
|
||||
mastodon_locked = models.BooleanField(default=False)
|
||||
mastodon_followers = models.JSONField(default=list)
|
||||
mastodon_following = models.JSONField(default=list)
|
||||
|
|
Loading…
Add table
Reference in a new issue