@rp, We have created an API get_user_details, whic...
# support-questions-legacy
n
@rp, We have created an API get_user_details, which gives us the details of the currently logged in user from the session object. But, we noticed, if the user's email is not verified and if the email verification is marked as 'REQUIRED', the API gives an 500 error whereas, if it is marked as Optional, it works. What could be the possible reason of the failure of the API, if the email is not verified? As the user is logged in, shouldn't the session object exist?
r
hey @namanchhabra_60978 have you added our middleware to the python backend? It should not give u a 500, but give you a 403
whats the error stack?
n
I'm so sorry, yes it was a 403 error
And yes I have added the middleware to the python backend and everything else is working fine
Only this issue we are facing
r
right
so the user has to go through the email verification flow
and verify their email. Only then will the api access be given,
since it's in required mode.
n
Actually, we wanted to show 2 different email verification screens: different for both email password auth and SSO. So, we needed the parameter that has the user logged in via thirdparty or not.. So we were trying to achieve this
Any other way to do so?
r
yea that is possible. In the session's access token, you can add if the user is email password or not, and then read that on the frontend, and then decide which screen to take the user to
n
cool! Thanks a lot @rp_st
2 Views