🚩 create user session when provision

create a user session after provisioning authentication if the account has been created previously.
This commit is contained in:
Rafi Arrafif
2025-08-12 23:59:06 +07:00
parent 27769773af
commit 6bdd5b6468
6 changed files with 66 additions and 13 deletions

View File

@ -27,10 +27,9 @@ export const findUserService = async (payload: getUserDataService) => {
payload.options.verbosity
);
// Retrieving user data using the associated repository, if user not found return 404 response
// Retrieving user data using the associated repository, if user not found return 'false' response
const userData = await repoFn(payload.identifier, payload.options.include);
if (!userData && existsVerbosity) return false;
if (!userData) throw new AppError(404, "User not found");
if (!userData) return false;
// If verbosity in 'exists' level and user is valid then just return 'true' value
if (existsVerbosity) return true;