If I want 1 account per device, How to do it with ST sessions?
s
If I want 1 account per device, How to do it with ST sessions?
r
hey @shahreaz0 you can override the create new session function to check if a user has sessions already, and if they do, then throw an error.
s
here?
r
Yup
s
inside this function how to determine user already have session or not?
r
See the functions from the session recipe please
s
this function needs req and res
ok
r
There is a function to get all the sessions of a user from a user id
And u can just count the result
s
nice. Thanks for your response
This gives me 500 range error. I want 400 range
r
You can catch the error in the api override for sign in. And then return a custom response to the frontend with a 400 status code
s
ok thanks
, I actually can't find out where I can modify the response. Help please. Give some examples
r
There are docs for that
Search for custom response
It’s In the override section of the docs
s
ok
I found it