ITEnthusiasm
06/13/2022, 4:28 PMRemix
with `SuperTokens`:
https://github.com/ITenthusiasm/remix-supertokens
Does SuperTokens ever review this kind of stuff? If it's written correctly, it should enable people to get auth up and running without end users needing to enable JavaScript. It might also give new ideas for the default forms exported by SuperTokens.
If it's written incorrectly or I'm missing any use cases / error cases (specifically within login/signup/resetting passwords), I can try to fix those. 🙂
The 2 things I hope to add in the future are specified in the TODO list. (They are JS-enhanced forms and a local db example... if I find time.)ITEnthusiasm
06/13/2022, 4:29 PMrp_st
06/13/2022, 4:29 PMrp_st
06/13/2022, 4:31 PMITEnthusiasm
06/13/2022, 4:31 PMITEnthusiasm
06/13/2022, 4:31 PMrp_st
06/13/2022, 4:31 PMITEnthusiasm
06/13/2022, 4:34 PMsupertokens-website
handles the session refreshing for us, then it shouldn't be too hard to add that into the app.rp_st
06/13/2022, 4:34 PMrp_st
06/13/2022, 4:35 PMITEnthusiasm
06/13/2022, 4:35 PMITEnthusiasm
06/13/2022, 4:36 PMrp_st
06/13/2022, 4:36 PMITEnthusiasm
06/13/2022, 4:41 PMITEnthusiasm
06/27/2022, 10:04 PMsupertokens-website
should be pretty easy to do from the client-side root
file.rp_st
06/28/2022, 4:03 AMITEnthusiasm
07/01/2022, 9:45 PMrp_st
07/02/2022, 4:53 AMrp_st
07/02/2022, 4:54 AM/login
server route, but then how does that leverage the API route for login exposed by the supertokens' middleware?ITEnthusiasm
07/02/2022, 2:07 PMrp_st
07/02/2022, 2:07 PMITEnthusiasm
07/02/2022, 2:07 PMaction
functions in Remix routes are responsible for handling form submissions. So if you look at the action
function inside the login.tsx
route, you'll see that I'm grabbing the login data and then sending it to the SuperTokens route in a way that it can understand.
Since the SuperTokens routes exist on the same server, this results in the server making a request to itself. This is necessary in order to guarantee that I can leverage how Remix handles forms (and to guarantee that people can login without JS). However, from what I understand, when Remix sees that the server is making a request to itself, it will instead invoke the appropriate middleware without making any HTTP requests (thankfully).rp_st
07/02/2022, 2:11 PMITEnthusiasm
07/02/2022, 5:15 PM