Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 87 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"e2e": "playwright test"
},
"dependencies": {
"@better-auth/oauth-provider": "1.6.27",
"@better-auth/oauth-provider": "1.7.5",
"@hono/node-server": "^2.1.0",
"better-auth": "^1.6.20",
"better-auth": "^1.7.5",
"date-fns": "^4.4.0",
"hono": "^4.13.1",
"hono-pino": "^0.10.3",
Expand Down
6 changes: 2 additions & 4 deletions src/app/db/seed-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* first-party client row via raw SQL.
*/

// ponytail: raw SQL because Better Auth doesn't expose a public API to
// create OAuth clients without admin auth. If the schema changes, update here.
export async function seedPlannerClient(db, redirectUris, schemaName) {
const uris = Array.isArray(redirectUris) ? redirectUris : [redirectUris];
// Validate schemaName to prevent SQL injection — only alphanumeric + underscore
Expand All @@ -20,11 +18,11 @@ export async function seedPlannerClient(db, redirectUris, schemaName) {
const sql = `INSERT INTO ${table} (
id, "clientId", "clientSecret", name, "redirectUris",
"grantTypes", "responseTypes", "tokenEndpointAuthMethod",
"public", "skipConsent", "requirePKCE", "createdAt", "updatedAt"
"skipConsent", "requirePKCE", "createdAt", "updatedAt"
) VALUES (
'planner-seed', 'planner', NULL, 'Codebar Planner',
$1::jsonb, to_jsonb(ARRAY['authorization_code']),
to_jsonb(ARRAY['code']), 'none', true, true, true,
to_jsonb(ARRAY['code']), 'none', true, true,
NOW(), NOW()
)
ON CONFLICT ("clientId") DO UPDATE SET "redirectUris" = $1::jsonb`;
Expand Down
4 changes: 3 additions & 1 deletion test/features/oauth-provider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ test("OAuth Provider plugin tests", async (t) => {

t.ok(client, "planner client exists");
t.equal(client.clientId, "planner", "clientId is planner");
t.equal(client.public, true, "client is public");
t.notOk("public" in client, "legacy public column is not in the schema");
t.notOk("type" in client, "legacy type column is not in the schema");
t.equal(client.skipConsent, true, "consent is skipped");
t.equal(client.requirePKCE, true, "PKCE is required");
t.equal(
client.tokenEndpointAuthMethod,
Expand Down
Loading