https://supertokens.com/ logo
get user ID before login
m

monster7

05/05/2023, 9:43 AM
Hii, I have integrated super token's passwordless recipe for Python fastAPI and there is a scenario in which I need the user's user_id at a verify code time(before login) Is there any way to get the user_id by access token? Thanks
r

rp

05/05/2023, 10:20 AM
hey @monster7 you can override the consume code function on the backend sdk (override.functions), and call the original implemenation first. If that succeeds, you get back a user object containing the user ID. This happens before a session is created since this is in the functions override and not the APIs override.