diff --git a/backend/src/api/controllers/result.ts b/backend/src/api/controllers/result.ts
index b6fc4bf4d..5f32af2c0 100644
--- a/backend/src/api/controllers/result.ts
+++ b/backend/src/api/controllers/result.ts
@@ -327,7 +327,7 @@ export async function addResult(
(funbox === "none" || funbox === "plus_one" || funbox === "plus_two") &&
!bailedOut &&
!user.banned &&
- (user.timeTyping ?? 0) > 7200;
+ (process.env.MODE === "dev" || (user.timeTyping ?? 0) > 7200);
if (dailyLeaderboard && validResultCriteria) {
incrementDailyLeaderboard(result.mode, result.mode2, result.language);
diff --git a/backend/src/api/controllers/user.ts b/backend/src/api/controllers/user.ts
index 84de019f2..fbeafc7dc 100644
--- a/backend/src/api/controllers/user.ts
+++ b/backend/src/api/controllers/user.ts
@@ -103,13 +103,17 @@ export async function getUser(
try {
userInfo = await UserDAL.getUser(uid, "get user");
} catch (e) {
- await admin.auth().deleteUser(uid);
- throw new MonkeyError(
- 404,
- "User not found. Please try to sign up again.",
- "get user",
- uid
- );
+ if (e.status === 404) {
+ await admin.auth().deleteUser(uid);
+ throw new MonkeyError(
+ 404,
+ "User not found. Please try to sign up again.",
+ "get user",
+ uid
+ );
+ }
+
+ throw e;
}
const agentLog = buildAgentLog(req);
diff --git a/backend/src/dal/leaderboards.ts b/backend/src/dal/leaderboards.ts
index 95eddf6a3..45d011c87 100644
--- a/backend/src/dal/leaderboards.ts
+++ b/backend/src/dal/leaderboards.ts
@@ -78,7 +78,9 @@ export async function update(
$exists: true,
},
banned: { $exists: false },
- timeTyping: { $gt: 7200 },
+ timeTyping: {
+ $gt: process.env.MODE === "dev" ? 0 : 7200,
+ },
},
},
{
diff --git a/frontend/src/ts/elements/leaderboards.ts b/frontend/src/ts/elements/leaderboards.ts
index 948ccdf07..4d3e903bf 100644
--- a/frontend/src/ts/elements/leaderboards.ts
+++ b/frontend/src/ts/elements/leaderboards.ts
@@ -133,7 +133,10 @@ function updateFooter(lb: LbKey): void {
return;
}
- if ((DB.getSnapshot().globalStats?.time ?? 0) < 7200) {
+ if (
+ window.location.hostname !== "localhost" &&
+ (DB.getSnapshot().globalStats?.time ?? 0) < 7200
+ ) {
$(`#leaderboardsWrapper table.${side} tfoot`).html(`
Your account must have 2 hours typed to be placed on the leaderboard.>
diff --git a/frontend/static/privacy-policy.html b/frontend/static/privacy-policy.html
index a9d514b2c..8f23c3a0b 100644
--- a/frontend/static/privacy-policy.html
+++ b/frontend/static/privacy-policy.html
@@ -270,7 +270,7 @@
Cookies are text files placed on your computer to collect standard
Internet log information and visitor behavior information. When you
visit our websites, we may collect information from you automatically
- through cookies or similar technology
+ through cookies or similar technology.
For further information, visit
@@ -320,7 +320,7 @@
Monkeytype keeps its privacy policy under regular review and places
any updates on this web page. The Monkeytype privacy policy may be
subject to change at any given time without notice. This privacy
- policy was last updated on 21 February 2022.
+ policy was last updated on 19 June 2022.
diff --git a/frontend/static/terms-of-service.html b/frontend/static/terms-of-service.html
index 8c9b47eb6..8877b6bc1 100644
--- a/frontend/static/terms-of-service.html
+++ b/frontend/static/terms-of-service.html
@@ -110,7 +110,7 @@
- These terms of service were last updated on September 11, 2021.
+ These terms of service were last updated on June 19, 2022.
Agreement
By accessing this Website, accessible from monkeytype.com, you are
@@ -235,8 +235,8 @@
contact' requests from us or Users.
Limitations on Automated Use
- You shouldn't use bots or access our Services in malicious or
- un-permitted ways. While accessing or using the Services, you may not:
+ You shouldn't use bots or access our Services in malicious or prohibited
+ ways. While accessing or using the Services, you may not:
- use bots, hacks, or cheats while using our site;
- create manual requests to Monkeytype servers;
diff --git a/frontend/webpack/config.base.js b/frontend/webpack/config.base.js
index 4e028f9c0..9110d05eb 100644
--- a/frontend/webpack/config.base.js
+++ b/frontend/webpack/config.base.js
@@ -8,6 +8,20 @@ const ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin");
let circularImports = 0;
+const htmlWebpackPlugins = [
+ "terms-of-service",
+ "security-policy",
+ "privacy-policy",
+ "email-handler",
+ "das",
+].map((name) => {
+ return new HtmlWebpackPlugin({
+ filename: `${name}.html`,
+ template: resolve(__dirname, `../static/${name}.html`),
+ inject: false,
+ });
+});
+
/** @type { import('webpack').Configuration } */
const BASE_CONFIG = {
entry: {
@@ -96,6 +110,7 @@ const BASE_CONFIG = {
template: resolve(__dirname, "../static/main.html"),
inject: "body",
}),
+ ...htmlWebpackPlugins,
new MiniCssExtractPlugin({
filename: "./css/style.[chunkhash:8].css",
}),
diff --git a/frontend/webpack/config.dev.js b/frontend/webpack/config.dev.js
index 94a272ccd..804be9bdd 100644
--- a/frontend/webpack/config.dev.js
+++ b/frontend/webpack/config.dev.js
@@ -1,22 +1,5 @@
-const { resolve } = require("path");
const { merge } = require("webpack-merge");
const BASE_CONFIG = require("./config.base");
-const HtmlWebpackPlugin = require("html-webpack-plugin");
-
-const htmlWebpackPlugins = [
- "terms-of-service",
- "security-policy",
- "privacy-policy",
- "email-handler",
- "das",
-].map((name) => {
- return new HtmlWebpackPlugin({
- filename: `${name}.html`,
- template: resolve(__dirname, `../static/${name}.html`),
- inject: "body",
- cache: false,
- });
-});
/** @type { import('webpack').Configuration } */
const DEV_CONFIG = {
@@ -33,8 +16,6 @@ const DEV_CONFIG = {
overlay: false,
},
},
-
- plugins: htmlWebpackPlugins,
};
module.exports = merge(BASE_CONFIG, DEV_CONFIG);
diff --git a/frontend/webpack/config.prod.js b/frontend/webpack/config.prod.js
index 6795dfbaa..8649e4469 100644
--- a/frontend/webpack/config.prod.js
+++ b/frontend/webpack/config.prod.js
@@ -3,24 +3,9 @@ const { merge } = require("webpack-merge");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const HtmlMinimizerPlugin = require("html-minimizer-webpack-plugin");
const JsonMinimizerPlugin = require("json-minimizer-webpack-plugin");
-const HtmlWebpackPlugin = require("html-webpack-plugin");
const BASE_CONFIG = require("./config.base");
-const htmlWebpackPlugins = [
- "terms-of-service",
- "security-policy",
- "privacy-policy",
- "email-handler",
- "das",
-].map((name) => {
- return new HtmlWebpackPlugin({
- filename: `${name}.html`,
- template: resolve(__dirname, `../static/${name}.html`),
- inject: false,
- });
-});
-
function pad(numbers, maxLength, fillString) {
return numbers.map((number) =>
number.toString().padStart(maxLength, fillString)
@@ -79,7 +64,6 @@ const PRODUCTION_CONFIG = {
new CssMinimizerPlugin(),
],
},
- plugins: htmlWebpackPlugins,
};
module.exports = merge(BASE_CONFIG, PRODUCTION_CONFIG);
|