diff --git a/package.json b/package.json index fe7c918..3fb2fba 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "scripts": { "prepare": "husky install", "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", - "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", + "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 TS_NODE_COMPILER=typescript-cached-transpile next dev", "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/", "test": "jest test --env=jsdom", diff --git a/src/app/components/useCurrentUser.js b/src/app/components/useCurrentUser.js index 359eae9..a473700 100644 --- a/src/app/components/useCurrentUser.js +++ b/src/app/components/useCurrentUser.js @@ -18,27 +18,6 @@ function useCurrentUser() { 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: ``, - }; - } - if (authMode === "auth0") { return currentUserViaAuth0; } else if (authMode === "db") { diff --git a/src/server/auth.js b/src/server/auth.js index eadf361..d4e5927 100644 --- a/src/server/auth.js +++ b/src/server/auth.js @@ -17,18 +17,6 @@ async function getJwtKey(header, callback) { } 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) { return null; }