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");
|
currentUrl.searchParams.delete("state");
|
||||||
const issuerParam = matchedRoute.params.issuer;
|
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),
|
where: (flow, { eq }) => eq(flow.id, matchedRoute.query.flow),
|
||||||
with: {
|
with: {
|
||||||
application: true,
|
application: true,
|
||||||
|
|
@ -144,7 +144,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const userId = (
|
const userId = (
|
||||||
await db.query.openIdAccount.findFirst({
|
await db.query.OpenIdAccounts.findFirst({
|
||||||
where: (account, { eq, and }) =>
|
where: (account, { eq, and }) =>
|
||||||
and(eq(account.serverId, sub), eq(account.issuerId, issuer.id)),
|
and(eq(account.serverId, sub), eq(account.issuerId, issuer.id)),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue