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

Commit

Permalink
Fix requestOpenIdToken response: integer expires_in
Browse files Browse the repository at this point in the history
`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 <lukas@lihotzki.de>
  • Loading branch information
lukaslihotzki committed Jun 14, 2021
1 parent 1dfdc87 commit 2ab40f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10175.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Return an integer `expires_in` in requestOpenIdToken response.
2 changes: 1 addition & 1 deletion synapse/rest/client/v2_alpha/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def on_POST(self, request, user_id):
"access_token": token,
"token_type": "Bearer",
"matrix_server_name": self.server_name,
"expires_in": self.EXPIRES_MS / 1000,
"expires_in": self.EXPIRES_MS // 1000,
},
)

Expand Down

0 comments on commit 2ab40f8

Please sign in to comment.