mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Fix incorrect db fetching code breaking OAuth2
This commit is contained in:
parent
9804180123
commit
f9f4a99cb9
|
|
@ -49,7 +49,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
|||
currentUrl.searchParams.delete("state");
|
||||
const issuerParam = matchedRoute.params.issuer;
|
||||
|
||||
const flow = await db.query.openIdLoginFlow.findFirst({
|
||||
const flow = await db.query.OpenIdLoginFlows.findFirst({
|
||||
where: (flow, { eq }) => eq(flow.id, matchedRoute.query.flow),
|
||||
with: {
|
||||
application: true,
|
||||
|
|
@ -144,7 +144,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
|||
);
|
||||
|
||||
const userId = (
|
||||
await db.query.openIdAccount.findFirst({
|
||||
await db.query.OpenIdAccounts.findFirst({
|
||||
where: (account, { eq, and }) =>
|
||||
and(eq(account.serverId, sub), eq(account.issuerId, issuer.id)),
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue