diff --git a/.gitignore b/.gitignore
index 961d058fe45b8973e9896255336674842c5b7a53..3eb23ec54d5478f62f9b4ef0d773b200db7b5c5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,5 @@ yarn-error.log*
out_functions
out_publish
+
+.env
diff --git a/netlify.toml b/netlify.toml
index a451de4f83ae042f3b893de6d7dc04206bc7556a..a1844535b8d2ffae9864c9cbb23ae963f4e83aec 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,4 +1,9 @@
[build]
command = "npm run build"
- functions = "out_functions"
- publish = "out_publish"
\ No newline at end of file
+ publish = "out_publish"
+
+[[headers]]
+ for = "/*"
+ [headers.values]
+ X-Frame-Options = "DENY"
+ X-XSS-Protection = "1; mode=block"
\ No newline at end of file
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6f27bb66a3469f5c7b71b7abe8b47636dc0fcefb
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow:
\ No newline at end of file
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 4d524b276aaa832cc80d6c8c2b58a4e6554aea1f..f34ceba934d139228d28237ad72dbca6f24bf664 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -13,6 +13,7 @@ const Navbar = styled.div`
margin-bottom: 10px;
position: sticky;
top: 0;
+ z-index: 1;
`;
export default Navbar;
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 861378292b8610629c6637510725007c2349f493..5499dc9ab410c59f791ceefcb51bf680e9e5662d 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -10,6 +10,7 @@ import { clearData, getData, LS_KEYS } from 'utils/storage/localStorage';
import { useRouter } from 'next/router';
import Container from 'components/Container';
import PowerSettings from 'components/power_settings';
+import Head from 'next/head';
const GlobalStyles = createGlobalStyle`
html, body {
@@ -82,6 +83,9 @@ export default function App({ Component, pageProps }) {
return (
<>
+
+ ente.io | Privacy friendly alternative to Google Photos
+
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index 3313c609b219998ed60a634b0578d0cd295243c7..96c1ad3a4d2a0c93cdc4e41d14435b303c31d4b3 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -34,7 +34,6 @@ export default class MyDocument extends Document {
return (
- ente.io | Privacy friendly alternative to Google Photos
();
const [loading, setLoading] = useState(false);
-
+
useEffect(() => {
+ router.prefetch('/gallery');
const user = getData(LS_KEYS.USER);
const keyAttributes = getData(LS_KEYS.KEY_ATTRIBUTES);
const key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
diff --git a/src/pages/generate/index.tsx b/src/pages/generate/index.tsx
index 4efbb153ed1f68da2490230a4060cddffd8d0b82..012b275ba87e4b4530c174a1cbddd5bb6089bbd2 100644
--- a/src/pages/generate/index.tsx
+++ b/src/pages/generate/index.tsx
@@ -31,8 +31,9 @@ export default function Generate() {
const [token, setToken] = useState();
const router = useRouter();
const key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
-
+
useEffect(() => {
+ router.prefetch('/gallery');
const user = getData(LS_KEYS.USER);
if (!user?.token) {
router.push("/");
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 0b1f5a0ee9772b9a56ee383212ac3c4924050cfb..db2514b9a8acd29dbbc12fd347d2dd70c81caf7f 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -18,8 +18,9 @@ interface formValues {
export default function Home() {
const [loading, setLoading] = useState(false);
const router = useRouter();
-
+
useEffect(() => {
+ router.prefetch('/verify');
const user = getData(LS_KEYS.USER);
if (user?.email) {
router.push('/verify');
diff --git a/src/pages/verify/index.tsx b/src/pages/verify/index.tsx
index 02912113a30dd15366c4919f2f4614a8b96c2396..638f4f6655ca580e990bdccc2575f0e711497acf 100644
--- a/src/pages/verify/index.tsx
+++ b/src/pages/verify/index.tsx
@@ -26,8 +26,10 @@ export default function Verify() {
const [loading, setLoading] = useState(false);
const [resend, setResend] = useState(0);
const router = useRouter();
-
+
useEffect(() => {
+ router.prefetch('/credentials');
+ router.prefetch('/generate');
const user = getData(LS_KEYS.USER);
if (!user?.email) {
router.push("/");
diff --git a/src/services/userService.ts b/src/services/userService.ts
index 021360deaa19b617abcaef490217ee26a4c2510b..22a96e0dca43b29f01a65827d433e22fff8c24d5 100644
--- a/src/services/userService.ts
+++ b/src/services/userService.ts
@@ -1,16 +1,20 @@
import HTTPService from './HTTPService';
import { keyAttributes } from 'types';
+const dev = process.env.NODE_ENV === 'development';
+const API_ENDPOINT = process.env.NEXT_PUBLIC_ENTE_ENDPOINT || "https://api.staging.ente.io";
+const ENDPOINT = !dev ? API_ENDPOINT : '/api'
+
export const getOtt = (email: string) => {
- return HTTPService.get('/api/users/ott', { email })
+ return HTTPService.get(`${ENDPOINT}/users/ott`, { email })
}
export const verifyOtt = (email: string, ott: string) => {
- return HTTPService.get('/api/users/credentials', { email, ott });
+ return HTTPService.get(`${ENDPOINT}/users/credentials`, { email, ott });
}
export const putKeyAttributes = (token: string, keyAttributes: keyAttributes) => {
- return HTTPService.put('/api/users/key-attributes', keyAttributes, null, {
+ return HTTPService.put(`${ENDPOINT}/users/key-attributes`, keyAttributes, null, {
'X-Auth-Token': token,
});
}