From ceef9f024c7d64a88250bce2cbb31345dcdd1690 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 6 Jan 2024 23:49:05 +0100 Subject: [PATCH] Fix login for restricted users Previously this led to an OAuth grant with an empty scope, which could not be used for anything. --- snikket_web/prosodyclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snikket_web/prosodyclient.py b/snikket_web/prosodyclient.py index 70c40d5..ca2ecfe 100644 --- a/snikket_web/prosodyclient.py +++ b/snikket_web/prosodyclient.py @@ -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)")