https://supertokens.com/ logo
Title
i

ITEnthusiasm

11/22/2022, 1:30 PM
I feel like I asked this earlier. 🤔 (If I did, sorry. 😩) Is there an easy way to replicate the middleware logic that SuperTokens requires? On an express server, I'm seeing that mainly 4 things are needed: 1)
SuperTokens.init
(once) 2)
cors
middleware 3) SuperTokens middleware 4) SuperTokens error handling middleware The reason I ask is that as more SSR frameworks come out (e.g., SolidStart, SvelteKit, etc.), I'm realizing that a lot of tools -- even some of Auth0's tools -- are restricted by the fact that they're expecting to be run directly on some kind of server (e.g., an express server). Of course, they are running on some kind of server. But the SSR frameworks try to abstract all of that away. This makes it hard (if not impossible) to apply the security logic which SuperTokens applies. These frameworks have "middleware-like" logic that can be supplied, but oftentimes this is incompatible with "real middleware". Obviously this has been a problem for other similar auth options so far. But if SuperTokens were able to provide a way to integrate with these frameworks universally (or maybe a way can already be found from the codebase), it would have an edge on the other options -- at least as far as the crazy JS ecosystem is concerned.
r

rp

11/22/2022, 1:32 PM
hey @ITEnthusiasm what are the differences in terms of a middleware for these SSR based frameworks vs regular api servers?