Hey, I'm upgrading my app to nuxt3 and trying to f...
# general
k
Hey, I'm upgrading my app to nuxt3 and trying to figure out how to implement SuperTokens into their new routing system. I was trying to find a way of implementing express configuration into that but it didn't work out. Is it possible rn or do I have to wait for an update on SuperTokens?
Hey, I'm upgrading my app to nuxt3 and trying to figure out how to implement SuperTokens into their new routing system. I was trying to find a way of implementing express configuration into that but it didn't work out. Is it possible rn or do I have to wait for an update on SuperTokens?
Update to the thread: I started looking which package Nuxt3 uses for routing and found out it's H3. And right now I'm trying to add it to SuperTokens by myself. Whish me luck
Another Update: I have figured out how to create sessions on h3. Everything seems to work for now
r
Thanks @KitsuneKenshi. Would you mind sharing an example of it?
k
You can see my progress on one of forks I have made, my nickname is kall7 on GitHub
Hey, I have a question about /auth/refresh. I couldn't find where you implement it and it causes issues with integrating it with h3
r
It’s exposed as one of the APIs of the session recipe
When u add the supertokes middleware to your app
k
Alright. So I have issue with refreshing tokens, I'm not sure where exactly the issue is cuz, console logs doesn't show up. Even test console log in middleware didn't show up.
r
Hmmmm. Can you enable debug logging on the backend SDK and see the output?
k
Where do i turn it on? cuz I can't find debug option
r
See troubleshooting section in docs
k
I'm getting no logs, only when starting app and that's all
r
It means that the refresh api call is not reaching the middleware
k
huh. that's weird cuz yesterday when I was testing session creation everything was fine
alright i fixed it
Well I got this after figuring out few things
r
Hmmm. What is the value of apiBasePath?
k
/api/auth
r
Hmm. That’s really odd then
Cause the refresh api and method r correct
Are you setting the apiGateway path config as well?
Can I see the debug logs when the app starts?
Hmm. The issue could be cause u r giving h3 as a framework. We don’t support that
k
Well that's what nuxt3 is using and I'm trying to create h3 integration to SuperTokens
r
Hmmm
Ur source code is open source right?
k
ye
r
If you open an issue about this, I can have a look
And help Debig the code
k
eee... it started but retuns 404
r
So it is handling the request now
k
ye
but still returns 404
r
Are you correctly setting the status code based on the result of the middleware?
k
you're using .setStatusCode() function to set the code in error handler right?
r
Yes. And also send json response. And sometimes we even set it to 401
k
It gets even weirder, cuz it does set it to 401 but it doesn't return 401..
r
Hmmm. Well. I’ll have a look at the code in the coming days
k
h3 have weird typing, and that's what causes it to be hard to make
Idk if it's just a typescript bug or what, but types for H3 are broken af
this is definition of type, but when I want to use it I only get event, res and req as valid options
r
Hmmmm I’ll have a look soon
k
Alright
I've messaged one of h3 authors about it, so We have to wait for answer and keep trying to figure it out
I've managed to fix it
Alr. For now refreshing and logging in works
now checking session left
Got it
everything works now
from basic functions
like getSession() createNewSession() etc
but it's impossible to use verifySession() as it is rn
How do you handle returning 401 in verify session?
well
it works
but it's weird
using it like this:
router.use("<path>", verifySession())
doesn't work but using it like this:
app.use("<path>", verifySession())
works just fine
in theory it's the same
wait
no
sorry it's not the same
but still
it's going to be weird to set it up
If you want to check it out I have uploaded the latest changes to my repo
Hey, @rp would it be a problem for you to list all functions available to the user that uses request or response? It would help me in testing everything
As i went through docs I think I've made all framework related functions. So it should work. Now just need to build it using build-pretty, and write some tests
nvm, I think I'll have to leave tests to you cuz I cannot run them for some reason
I've made PR for the changes feel free to review it