Skip to content

Commit 60d33de

Browse files
fix(oauth): correct parameter order for sign_in_identity and sign_up_identity
The database functions expect (remember_me, device_token) but the code was passing (device_token, remember_me). Fixed the SQL parameter types and argument order to match the database function signatures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5d06839 commit 60d33de

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

graphql/server/src/middleware/oauth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ export function createOAuthRoutes(opts: ConstructiveOptions): Router {
471471

472472
const signInSql = `
473473
SELECT * FROM "${privateSchema}".sign_in_identity(
474-
$1::text, $2::text, $3::jsonb, $4::text, 'access_token'::text, $5::text, $6::boolean
474+
$1::text, $2::text, $3::jsonb, $4::text, 'access_token'::text, $5::boolean, $6::text
475475
)
476476
`;
477477

@@ -481,8 +481,8 @@ export function createOAuthRoutes(opts: ConstructiveOptions): Router {
481481
profile.providerId,
482482
JSON.stringify(details),
483483
profile.email,
484-
deviceToken,
485484
true,
485+
deviceToken,
486486
]);
487487

488488
result = signInResult.rows[0] || {};
@@ -518,7 +518,7 @@ export function createOAuthRoutes(opts: ConstructiveOptions): Router {
518518
// Call sign_up_identity (using same client with JWT context)
519519
const signUpSql = `
520520
SELECT * FROM "${privateSchema}".sign_up_identity(
521-
$1::text, $2::text, $3::text, $4::jsonb, 'access_token'::text, $5::text, $6::boolean
521+
$1::text, $2::text, $3::text, $4::jsonb, 'access_token'::text, $5::boolean, $6::text
522522
)
523523
`;
524524

@@ -527,8 +527,8 @@ export function createOAuthRoutes(opts: ConstructiveOptions): Router {
527527
profile.providerId,
528528
profile.email,
529529
JSON.stringify(details),
530-
deviceToken,
531530
true,
531+
deviceToken,
532532
]);
533533

534534
result = signUpResult.rows[0] || {};

0 commit comments

Comments
 (0)