mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 21:15:27 -04:00
Update MSC2918 refresh token support to confirm with the latest revision: accept the refresh_tokens
parameter in the request body rather than in the URL parameters. (#11430)
This commit is contained in:
parent
ffd858aa68
commit
1b6691dce4
4 changed files with 58 additions and 22 deletions
|
@ -38,7 +38,6 @@ from synapse.http.server import HttpServer, finish_request
|
|||
from synapse.http.servlet import (
|
||||
RestServlet,
|
||||
assert_params_in_dict,
|
||||
parse_boolean,
|
||||
parse_bytes_from_args,
|
||||
parse_json_object_from_request,
|
||||
parse_string,
|
||||
|
@ -165,11 +164,14 @@ class LoginRestServlet(RestServlet):
|
|||
login_submission = parse_json_object_from_request(request)
|
||||
|
||||
if self._msc2918_enabled:
|
||||
# Check if this login should also issue a refresh token, as per
|
||||
# MSC2918
|
||||
should_issue_refresh_token = parse_boolean(
|
||||
request, name=LoginRestServlet.REFRESH_TOKEN_PARAM, default=False
|
||||
# Check if this login should also issue a refresh token, as per MSC2918
|
||||
should_issue_refresh_token = login_submission.get(
|
||||
"org.matrix.msc2918.refresh_token", False
|
||||
)
|
||||
if not isinstance(should_issue_refresh_token, bool):
|
||||
raise SynapseError(
|
||||
400, "`org.matrix.msc2918.refresh_token` should be true or false."
|
||||
)
|
||||
else:
|
||||
should_issue_refresh_token = False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue