feat: admin routes + better auth routing

This commit is contained in:
2025-05-30 18:17:12 +02:00
parent db2cb36f54
commit 51b7e6b3f9
10 changed files with 133 additions and 59 deletions

View File

@ -3,16 +3,16 @@ INSERT INTO api_services (
client_id, client_secret, name, redirect_uris, scopes, grant_types
) VALUES (
$1, $2, $3, $4, $5, $6
) RETURNING *;
) RETURNING id,client_id,name,redirect_uris,scopes,grant_types,created_at,updated_at,is_active;
-- name: GetApiServiceCID :one
SELECT * FROM api_services
SELECT id,client_id,name,redirect_uris,scopes,grant_types,created_at,updated_at,is_active FROM api_services
WHERE client_id = $1
AND is_active = true
LIMIT 1;
-- name: ListApiServices :many
SELECT * FROM api_services
SELECT id,client_id,name,redirect_uris,scopes,grant_types,created_at,updated_at,is_active FROM api_services
ORDER BY created_at DESC;
-- name: UpdateApiService :one
@ -24,7 +24,7 @@ SET
grant_types = $5,
updated_at = NOW()
WHERE client_id = $1
RETURNING *;
RETURNING id,client_id,name,redirect_uris,scopes,grant_types,created_at,updated_at,is_active;
-- name: DeactivateApiService :exec
UPDATE api_services
@ -36,4 +36,4 @@ WHERE client_id = $1;
UPDATE api_services
SET client_secret = $2,
updated_at = NOW()
WHERE client_id = $1;
WHERE client_id = $1;