matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

/_synapse/admin/v1/register ignores refresh_token #16641

Closed cvwright closed 11 months ago

cvwright commented 11 months ago

Description

The admin API endpoint for registering users works almost just like the register client-server /register endpoint. However, it does not create a refreshable access token when one is requested.

The fix appears to be to change this call https://github.com/matrix-org/synapse/blob/43d1aa75e8cbf9d522b425d51d5ac1a742b59ffb/synapse/rest/admin/users.py#L648

To something like this

should_issue_refresh_token = body.get("refresh_token", False)

result = await register._create_registration_details(user_id, body, should_issue_refresh_token=should_issue_refresh_token)

Steps to reproduce

Homeserver

Circles dev homeserver

Synapse Version

1.94.0

Installation Method

Docker (matrixdotorg/synapse)

Database

single PostgreSQL server

Workers

Multiple workers

Platform

Debian 12.2 x86, AMD EPYC, Hetzner cloud

Configuration

No response

Relevant log output

n/a

Anything else that would be useful to know?

No response

cvwright commented 11 months ago

Closed in https://github.com/matrix-org/synapse/pull/16642