https://supertokens.com/ logo
#support-questions
Title
# support-questions
w

web3geek

06/05/2022, 5:13 PM
@rp Why do I always get a new device Id (and pre-auth id) for passwordless (OTP) login even if I'm using the same device?
r

rp

06/05/2022, 5:13 PM
Hey
Cause each passwordless auth attempt is essentially stateless
These are IDs that are meaningful only in that passwordless login session. The next time you sign in, it’s like a new passwordless auth session. So new IDs
w

web3geek

06/05/2022, 5:16 PM
so if I want something like whatsapp - can only use my app on one device at a time. how can I do that ?
r

rp

06/05/2022, 5:17 PM
Right. In that case, you can override the createNewSession function on the backend and check how many sessions exist for the input.userId
If more than 0 sessions exist, you can throw an error and deny login
Or, you can revoke the existing session and go ahead and create a new one
w

web3geek

06/05/2022, 5:18 PM
oh okay. can share some reference for this?
r

rp

06/05/2022, 5:18 PM
Which backend SDK?
w

web3geek

06/05/2022, 5:18 PM
nodejs
r

rp

06/05/2022, 5:19 PM
w

web3geek

06/05/2022, 5:30 PM
thanks
@Fabio Aguiar check this
f

Fabio Aguiar

06/06/2022, 3:51 AM
It seams perfect. Tks @rp
3 Views