element-hq / element-hq/matrix-authentication-service
Templates fail to render when authorization request doesn't contain a state parameter
- Dominant language
- Rust
- Stars
- 280
- Forks
- 111
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 25
Description
*This issue was originally created by [**@tonkku107**](https://github.com/tonkku107) at .*
Example authorization request url (fill in the blanks): `[mas_base_url]/authorize?response_type=code&client_id=[client_id]&scope=openid`
When logged out, an error page is rendered with the following error displayed:

```
Unexpected error
could not render template "pages/login.html"
Render { template: "pages/login.html", source: Error { kind: InvalidOperation, detail: "Could not serialize back parameters", name: "components/back_to_client.html", line: 41, source: Custom("unsupported value") } }
```
When logged in, an empty error 500 is returned with the following error in the logs:
```
ERROR http.server.request{otel.kind="server" otel.name="GET /consent/:grant_id" network.protocol.name="http" network.protocol.version="1.0" http.request.method="GET" url.path="/consent/01J0ZS9BWKQ35ZNN9P8ZW8KH5P" url.scheme="http" http.route="/consent/:grant_id" user_agent.original="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"}:handlers.oauth2.consent.get{grant.id=01J0ZS9BWKQ35ZNN9P8ZW8KH5P}: mas_handlers::oauth2::consent: error=could not render template "pages/consent.html"
```
Contributor guide
Assessment
This issue has not been assessed yet.