Does `SuperTokens` support regular form HTTP posts...
# support-questions
i
Does
SuperTokens
support regular form HTTP posts? (As opposed to using json-ified data)
r
Not really. This will cause issues with verification of session
i
Really? I would think SuperTokens would just need to read email/password from the
FormData
. I acknowledge I don't know the internals though, of course. 😅
r
Well.. supertokens APIs accept only JSON inputs.
i
Gotcha. Well if it ever updated to also accept data from HTML Forms, that'd be super neat. The main reason is that I'm trying to figure out if there's a way to log the user in if JavaScript is disabled in the browser. If SuperTokens supported regular HTML Form posts this would be easily possible.
r
Ah I see. That will probably never be supported.
i
Ah, rip. 😅 Okay. Well if you guys ever decide to change your minds in the future, I think it's worth considering.
Remix
is shaking things up a bit and pointing web devs back to the basics, which means we may see a time when more regular HTML Form Posts are used. (Facebook's login, for instance, uses a regular
form
with proper
method
and
action
attributes.) If that's the case and other auth services support that approach, SuperTokens will be at a disadvantage because regular forms are easier to build and don't rely on JS to work -- though they may be enhanced by JS. (As it is, if I understand correctly, users without JS cannot log into applications using SuperTokens.)
r
Hmmm. The issue is that the result of the sign in api call requires setting some info in the frontend cookies, which can only happen if JS is run. Maybe in the future, we can add an option to the sessions to work without any JS running on the frontend from our side. Then it would be possible
i
Sounds cool! If something could work out in the future that'd be awesome! In the meantime I'll use the JS-dependent forms.
Coming back to this briefly after several weeks. I still think it'd be great if SuperTokens supported regular forms. However, I just discovered today that I can do a regular form post the way
Remix
expects to the Remix backend, and then use the request information there to cause the server to make a request to itself for email sign up/sign in. It's a little janky since it requires the backend to call itself. 🤔 But it opens the door for logins to happen with HTML-only in the meantime. Taking notes in case anyone stumbles on this problem in the future. Been trying to create an example app for using
SuperTokens
for some isomorphic framework. But Svelte Kit has issues. And I've been jumping a few hurdles in Remix. Hopefully I can make something people here find useful in Remix land.
r
thank you @ITEnthusiasm
9 Views