Description
The first implementation of CORS support was conservative about enabling login via CORS.
However most apps will want to enable login from CORS hosts, simply because that is where the UI is located. So we need to make an option to enable CORS for logins.
I think this could be another field in the CORS config object, named sessionOrigin
which would have an array of string origins as it's value.
For sugar, we could also have the option of true
in cases where there will be many origins and all should have login access.
This config would then be consulted in places like this:
I'm labeling this a bug because CORS is not useful for anything besides toy apps without this. Tag @jamiltz b/c he's about to run into this.
N.B. It would be easy to convince me that we should just remove the protection from the session endpoints, and if CORS is turned on at all, it's turned on for session stuff too.