Introduced a new config property in lib/utils/config.ts called AUTH_MODE. Changing the value of this variable will change the type of authentication the app uses. Refer to comments in lib/utils/common.types.ts to know about the different modes available
Refactored supertokensUtilities.ts to switch between recipes based on the value of AUTH_MODE
Changed Session.init in next-app to use headers for authentication instead of cookies
Updated the README to explain how to switch between auth methods
Backend Changes
Upgraded to latest version of supertokens-node
Refactored config logic to initialise the correct recipes with SuperTokens based on the value of AUTH_MODE (This change was made for the api layer of next-web)
Frontend Changes
Upgraded to the latest version of supertokens-web-js
Refactored config logic to initialise the correct recipes with SuperTokens based on the value of AUTH_MODE (This change was made for both next-web and next-app)
Refactored UI components to use a different form and functionality depending on the value of AUTH_MODE
Added UI components for Passwordless login, components only work with email + input codes for now but can be extended for magic links
Summary of changes
General Changes
lib/utils/config.ts
calledAUTH_MODE
. Changing the value of this variable will change the type of authentication the app uses. Refer to comments inlib/utils/common.types.ts
to know about the different modes availablesupertokensUtilities.ts
to switch between recipes based on the value ofAUTH_MODE
Session.init
innext-app
to use headers for authentication instead of cookiesBackend Changes
AUTH_MODE
(This change was made for the api layer ofnext-web
)Frontend Changes
AUTH_MODE
(This change was made for bothnext-web
andnext-app
)AUTH_MODE