important
This is a contributors guide and NOT a user guide. Please visit these docs if you are using or evaluating SuperTokens.
Auth method chosen by frontend preference and backend validation
Status
This is just a proposal so far, it hasn't been accepted and needs further discussion.
- Status:
- proposed
- Deciders:
- rishabhpoddar, porcellus
- Proposed by:
- porcellus
- Created:
- 2022-10-25
#
Context and Problem StatementWe have to decide which auth method (header or cookies) to use when creating/verifying/refreshing sessions for each request.
#
Considered Options- Configured on the backend
- Configured on both
- Configured only on the frontend and sent along the request
- Preference set set on the frontend and controlled by the backend
#
Decision OutcomePreference set on the frontend (and sent with request) and validated by the backend.
- By default the backend respects the preference, but can be configured to ignore it.
#
Pros and Cons of the Options#
Configured on the backend#
Configured on both (with a simple value)#
Configured only on the frontend and sent along the request#
Preference set on the frontend (and sent with request) and validated (or controlled) by the backend- configuration in two places
- Default on the backend will fit almost all use-cases)
- The configuration is not really duplicated