Guys I am facing an issue while fetching a user th...
# support-questions-legacy
v
Guys I am facing an issue while fetching a user through email. The auth dashboard shows the user is signedUp and Auth method under Email password. If there is any other method to go through forgot password flow. In the current flow from frontend it sends a token, so it does not verify if a user is already present in the database. It just sends out the email to whatever email you provide. Frontend is used for thirdparty Following is config file import ThirdPartyEmailPassword from "supertokens-node/recipe/thirdpartyemailpassword"; export function getApiDomain() { const apiPort = process.env.REACT_APP_API_PORT || 4001; const apiUrl = process.env.REACT_APP_API_URL || `http://localhost:${apiPort}`; return apiUrl; } export function getWebsiteDomain() { const websitePort = process.env.REACT_APP_WEBSITE_PORT || 3000; const websiteUrl = process.env.REACT_APP_WEBSITE_URL || `http://localhost:${websitePort}`; return websiteUrl; } export const SuperTokensConfig: TypeInput = { supertokens: { connectionURI: "localhost:3567", }, appInfo: { appName: "Auth Middleware Express", apiDomain: getApiDomain(), websiteDomain: getWebsiteDomain(), }, recipeList: [ ThirdPartyEmailPassword.init({ providers: [ // Google({ // clientId:"ID", // clientSecret: "SECRET", // }), ], }), Session.init({}), Dashboard.init(), UserMetadata.init(), ], }; Following is my controller file import { getUsersByEmail } from "supertokens-node/recipe/thirdpartyemailpassword"; export const createTokenForResetPassword = async (req: any, res: any) => { const { email } = req.body; try { const getUser = await getUserByEmail(email); console.log("EMAIL ", email); console.log("USER ",getUser); // const createVeriToken = await createResetPasswordToken(getUser.userId); res.send({ status: "OK" }); } catch (err) { res.status(500) } };
r
hey @vaz007. our API does not send the reset password email to users that don't have the email. Are you observing a different behaviour? Also, not sure what your question is.
v
I am unable to fetch users through the following controller file.
It gives me an empty array
r
Sorry, but I’m unable to understand the question and I can’t really go through your code this way. You will have to try and debug yourself or be more specific
2 Views