I'm new to *SuperTokens* and wanted to get some qu...
# support-questions-legacy
s
I'm new to SuperTokens and wanted to get some questions answered about using it, with a transition from NextAuth to SuperTokens
r
hey @Smultar please ask
s
As the question mentions above, I use NextAuth.
Something that limits me is that, nextauth doesnt allowed me to allow logins from other locations besides my website.
I'm making my app into a desktop app and I was wondering if I can use SuperTokens to handle logins outside of my website for user authenication
r
yea, that would work. I would recommend that you setup supertokens for your website first and see how it works. Once you have clarity on that, it should be fairly straightforward for how to get it to work for your desktop app as well
since this is a very generic question that you asked, i won't be able to answer it here. But if you have very specific questions, please feel free to ask 🙂
s
Next question
With user session objects, how are they accessed on the front end.
Will I have the ability to tell of someones email/id and etc?
r
yes
the session's access token payload is available on the frontend
you can add custom claims to it like (email etc), and then read that on the frontend
s
Can I edit/add stuff to this payload over time.
r
yes
s
If someone is rejects cause they have no login
They are directed to the login page.
Is it possible to redirect them back to the original page upon login @rp_st
r
yes
please see our docs 🙂 Would give you clarity.
s
I am reading them right now.
It just some things I havent seen in the docks yet
current reading nextjs segment
r
it's all there 🙂 Maybe search for it first
s
can I use other database types besides MySQL?
op never mind.
r
we only support mysql and postgresql
s
I found the mongo
r
mongodb has limited support only
s
wait so how does that work then?
session management?
r
yup
session management is there in mongo
s
wouldn't you need to login to get a session?
r
so you can pass in any user ID to the session recipe we have and it would create tokens etc
and login is something that you can handle yourself using something else
s
cause I use mongo db for my current application rn
r
right. If you want to use login features too of supertokens, consider our managed service in this case or then host mysql / postgresql as well
s
and I would like to have session management within mongo, cause its how users log out other devices.
r
if you only want to use the session management feature of ours, you can use mongodb
s
I'm slightly confused.
If I integrate supertokens right... Login services will be handled with the backend API with nextjs right.
Is mongodb only used for sessions only?
After the login with the backend api?
r
we only support mongodb for our session recipe
if you use mysql / psql, you can use any feature we have
we decouple our features (recipe is what we call them), so you can use our session only feature without using our login feature
s
ok so I dont understand what the session recipe is and what features you get with mysql vs nosql
r
see our docs please.
you get all features with sql. You only get session recipe with mongodb.
does this make sense?
s
I understand that, but I don't understand what the session recipe is.
r
see the session recipe docs. It explains it clearly 😅
s
Im reading what you sent me rp
r
ah right. So that's missing in the session recipe docs
s
It points me back to the NextJS Docs which I just read which tells me how to integrate.
r
see the non nextjs code snippets for session recipe. Maybe that will make it clearer.
essentially, the session recipe does session management only. You provide it a user id and we return access + refresh tokens using which you can manage your app's sessions.
we don't care where the user ID comes from.
Also, i see that you booked a call with us - if you only have technical quesitons, it's best to ask them here instead of a call.
Or would you like to discuss something else over a call?
s
Well, you answered my question over if SuperTokens would allow authentication on a different scale.
r
right
s
I'm just having a hard time with your docs a lil bit. I see what session recipes are now, via what you explained.
r
hmm
so you should pick a recipe based on the login method you want and use our managed service
ignore the mongodb stuff cause we don't yet fully support it
s
Yeah.
What I was hoping to do is to basically. Whenever someone logins, I get thoses refresh tokens/session and add it as an object in my mongodb database.
So users can see this on the frontend and invalidate sessions remotely.
r
right. You can do that still. Once users login via supertokens, you can override the create new session function on the backend to insert stuff into mongodb yourself.
s
I see that right here
r
yup.
s
If this works, I'll be able to convince my boss at work to let us swap our application login system.
r
sounds good.
Let us know if you have any other questions.
s
I always like to experiment first with my own stuff before recommending ya know
r
after you have tried it out 🙂
s
I will! Thank you for handling my silly questions @rp_st
r
for now, i have cancelled our call cause i think this answered your questions already. Hope that's ok
s
Thats fine!
So you know what im working on
My desktop application will support my app locally and allow privillaged intent for downloads and etc.
r
cool!!
s
r
let us know when launched
s
Were already partially live
r
looks quite fancy!
s
You can see the status here
and the app here.
I still have a few more patches till its stable, but its a work in progress.
I do have one more question.
If I have multiple sub-domains... would that affect authentication ?
I guess, it would, cause cookies are per sub-domain?
r
You can share one session across sub domains or keep them isolated to one sub domain.
s
OOO
THAT GOD TIER
Were can I read up on this @rp_st, in the docs?
s
Now to do that effectivetly. Would I need to have a seperate microservice or can each server have their own nextjs middleware?
r
im not sure i understand the question
s
So basically.
I have live, beta, dev and preview versions of the website. Each version is for testing and phases of development.
Each server, handles their own login system right now with next auth, so unique per sub domain.
If I were to use
.aetherlink.app
as the documentation states. I would be integrating SuperTokens into each instance.
r
yea i mean different dev envs should have their own full setup of supertokens
s
Would this mess with that, or would you advise a separate service?
r
in our managed service, we provide you with a dev and prod env. If you want more, you can request us for more envs (at a cost though)
or self host the extra cores yourself connected to mysql / psql
s
Can I buy you a coffee for your time @rp_st
r
tweet about us instead 🙂
s
I will
63 Views