Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2ab40f8

Browse files
committed
Fix requestOpenIdToken response: integer expires_in
`expires_in` must be an integer according to the OpenAPI spec: https://github.com/matrix-org/matrix-doc/blob/master/data/api/client-server/definitions/openid_token.yaml#L32 True division (`/`) returns a float instead (`"expires_in": 3600.0`). Floor division (`//`) returns an integer, so the response is spec compliant. Signed-off-by: Lukas Lihotzki <[email protected]>
1 parent 1dfdc87 commit 2ab40f8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/10175.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Return an integer `expires_in` in requestOpenIdToken response.

synapse/rest/client/v2_alpha/openid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def on_POST(self, request, user_id):
8585
"access_token": token,
8686
"token_type": "Bearer",
8787
"matrix_server_name": self.server_name,
88-
"expires_in": self.EXPIRES_MS / 1000,
88+
"expires_in": self.EXPIRES_MS // 1000,
8989
},
9090
)
9191

0 commit comments

Comments
 (0)