From 10ef78f4245212e7a3e19e3c250e75ad393ecdd2 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Wed, 10 Aug 2022 22:16:20 +0200 Subject: [PATCH] [user] fix mastodon keys, again --- server/routes/grantOverrides.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/server/routes/grantOverrides.js b/server/routes/grantOverrides.js index 902869a23..098616d82 100644 --- a/server/routes/grantOverrides.js +++ b/server/routes/grantOverrides.js @@ -31,13 +31,13 @@ const config = { const router = Router(); const mastodonGetOAuthKeys = async (db, instance) => { - const existingKeys = await db.get(SQL` - SELECT client_id, client_secret - FROM oauth_keys - WHERE instance = ${instance} - AND provider = 'mastodon' - `); // TODO figure out why it doesn't work + // const existingKeys = await db.get(SQL` + // SELECT client_id, client_secret + // FROM oauth_keys + // WHERE instance = ${instance} + // AND provider = 'mastodon' + // `); // if (existingKeys) { // return existingKeys; // } @@ -56,12 +56,10 @@ const mastodonGetOAuthKeys = async (db, instance) => { }).then(res => res.json()); assert(keys.client_id && keys.client_secret && !keys.error); // TODO figure out why it doesn't work - if (existingKeys) { - db.get(SQL` - INSERT INTO oauth_keys (instance, provider, client_id, client_secret) - VALUES (${instance}, 'mastodon', ${keys.client_id}, ${keys.client_secret}) - `); - } + // db.get(SQL` + // INSERT INTO oauth_keys (instance, provider, client_id, client_secret) + // VALUES (${instance}, 'mastodon', ${keys.client_id}, ${keys.client_secret}) + // `); return keys; };