Proposal
I propose to add the Plug.Conn
struct available inside the MFA configured for Phoenix.Endpoint.socket/3
under check_origin
.
Benefits
This would make possible to use url params or headers to check if the origin is allowed. Example: passing a user_id
param in the url, then checking somewhere else if the Origin
is allowed by that user.
Changes
The actual change seems quite simple as conn
is already present when the MFA is applied so. It would just need tests and modifying the documentation.
I would be more than happy to send the PR.