Fix login for restricted users

Previously this led to an OAuth grant with an empty scope, which could
not be used for anything.
This commit is contained in:
Kim Alvefur
2024-01-06 23:49:05 +01:00
parent 40c8b9cc36
commit ceef9f024c

View File

@@ -29,6 +29,7 @@ from . import xmpputil
from .xmpputil import split_jid
SCOPE_RESTRICTED = "prosody:restricted"
SCOPE_DEFAULT = "prosody:registered"
SCOPE_ADMIN = "prosody:admin"
@@ -399,7 +400,7 @@ class ProsodyClient:
request.add_field("password", password)
request.add_field(
"scope",
" ".join([SCOPE_DEFAULT, SCOPE_ADMIN])
" ".join([SCOPE_RESTRICTED, SCOPE_DEFAULT, SCOPE_ADMIN])
)
self.logger.debug("sending OAuth2 request (payload omitted)")