mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 20:19:19 +02:00
Added application token for easier auth
This commit is contained in:
parent
0dfe633d65
commit
f2e5969c44
9 changed files with 130 additions and 4 deletions
|
@ -31,8 +31,8 @@ from funkwhale_api.federation import models as federation_models
|
|||
from funkwhale_api.federation import utils as federation_utils
|
||||
|
||||
|
||||
def get_token():
|
||||
return binascii.b2a_hex(os.urandom(15)).decode("utf-8")
|
||||
def get_token(length=15):
|
||||
return binascii.b2a_hex(os.urandom(length)).decode("utf-8")
|
||||
|
||||
|
||||
PERMISSIONS_CONFIGURATION = {
|
||||
|
@ -350,6 +350,7 @@ class Invitation(models.Model):
|
|||
|
||||
class Application(oauth2_models.AbstractApplication):
|
||||
scope = models.TextField(blank=True)
|
||||
token = models.CharField(max_length=50, blank=True, null=True, unique=True)
|
||||
|
||||
@property
|
||||
def normalized_scopes(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue