🚧 wip: rewrite reprovision logic to match new user schema

This commit is contained in:
2026-05-28 21:01:54 +07:00
parent 8cebc0cd20
commit 57d19d4302
13 changed files with 120 additions and 110 deletions

View File

@ -0,0 +1,23 @@
import { AppError } from "../../../../helpers/error/instances/app";
import { prisma } from "../../../../utils/databases/prisma/connection";
export const findAuthIdentityByEmailAndProviderRepository = async (email: string) => {
try {
return await prisma.user.findUnique({
where: {
email: email,
},
select: {
id: true,
oauth_accounts: {
select: {
provider_sub: true,
provider_name: true,
},
},
},
});
} catch (error) {
throw new AppError(500, "Error finding user by email", error);
}
};