From 34a433c2732828cb5ec6e8cabb8668f45eba1daf Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 19 Jan 2022 16:05:58 -0600 Subject: [PATCH] protect statistics user name and redirect typos --- next.config.js | 9 +++++++++ .../20220119215304_statistics_names/migration.sql | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 prisma/migrations/20220119215304_statistics_names/migration.sql diff --git a/next.config.js b/next.config.js index 8181d6b2..8e9ddad2 100644 --- a/next.config.js +++ b/next.config.js @@ -28,5 +28,14 @@ module.exports = withPlausibleProxy()({ destination: '/api/lnurlp/:username' } ] + }, + async redirects () { + return [ + { + source: '/statistics', + destination: '/satistics?inc=invoice,withdrawal', + permanent: true + } + ] } }) diff --git a/prisma/migrations/20220119215304_statistics_names/migration.sql b/prisma/migrations/20220119215304_statistics_names/migration.sql new file mode 100644 index 00000000..cbbde184 --- /dev/null +++ b/prisma/migrations/20220119215304_statistics_names/migration.sql @@ -0,0 +1,2 @@ +UPDATE users set name = 'thanks_statistics' where name = 'statistics'; +INSERT INTO "users" ("name") VALUES ('statistics'); \ No newline at end of file