Remove unused IMPRESS_LOG_IN_AS feature

The latest version of Yarn's shell interpreter wasn't playing nice with
this undefined variable; okay! It's unused, let's just delete all
trace of it!
This commit is contained in:
Emi Matchu 2024-01-28 06:36:09 -08:00
parent 106fcf075f
commit f2fd019aa8
3 changed files with 2 additions and 35 deletions

View file

@ -61,8 +61,8 @@
"scripts": { "scripts": {
"prepare": "husky install", "prepare": "husky install",
"start": "next start", "start": "next start",
"dev": "DB_ENV=development yarn build-cached-data && DB_ENV=development REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev", "dev": "DB_ENV=development yarn build-cached-data && DB_ENV=development TS_NODE_COMPILER=typescript-cached-transpile next dev",
"local-prod": "DB_ENV=production yarn build-cached-data && DB_ENV=production REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev", "local-prod": "DB_ENV=production yarn build-cached-data && DB_ENV=production TS_NODE_COMPILER=typescript-cached-transpile next dev",
"build": "yarn build-cached-data && next build", "build": "yarn build-cached-data && next build",
"vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/", "vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/",
"test": "jest test --env=jsdom", "test": "jest test --env=jsdom",

View file

@ -18,27 +18,6 @@ function useCurrentUser() {
isEnabled: authMode === "db", isEnabled: authMode === "db",
}); });
// In development, you can start the server with
// `IMPRESS_LOG_IN_AS=12345 vc dev` to simulate logging in as user 12345.
//
// This flag shouldn't be present in prod anyway, but the dev check is an
// extra safety precaution!
//
// NOTE: In package.json, we forward the flag to REACT_APP_IMPRESS_LOG_IN_AS,
// because create-react-app only forwards flags with that prefix.
if (
process.env["NODE_ENV"] === "development" &&
process.env["REACT_APP_IMPRESS_LOG_IN_AS"]
) {
const id = process.env["REACT_APP_IMPRESS_LOG_IN_AS"];
return {
isLoading: false,
isLoggedIn: true,
id,
username: `<Simulated User ${id}>`,
};
}
if (authMode === "auth0") { if (authMode === "auth0") {
return currentUserViaAuth0; return currentUserViaAuth0;
} else if (authMode === "db") { } else if (authMode === "db") {

View file

@ -17,18 +17,6 @@ async function getJwtKey(header, callback) {
} }
async function getUserIdFromToken(token) { async function getUserIdFromToken(token) {
// In development, you can start the server with
// `IMPRESS_LOG_IN_AS=12345 vc dev` to simulate logging in as user 12345.
//
// This flag shouldn't be present in prod anyway, but the dev check is an
// extra safety precaution!
if (
process.env["NODE_ENV"] === "development" &&
process.env["IMPRESS_LOG_IN_AS"]
) {
return process.env["IMPRESS_LOG_IN_AS"];
}
if (!token) { if (!token) {
return null; return null;
} }