aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-05 07:51:08 -0800
committerAdam Soltys <[email protected]>2023-12-05 07:51:08 -0800
commita80fbe90d0fb7f82ea06a212ab304fd5062f10d2 (patch)
tree8ae206bc4553a230fe8796fe7052da308776efc7
parent152900e464169e3fffea076af5c6252f12f7645a (diff)
downloadcoinos-ui-a80fbe90d0fb7f82ea06a212ab304fd5062f10d2.tar.gz
coinos-ui-a80fbe90d0fb7f82ea06a212ab304fd5062f10d2.zip
change pwa landing page to /start
-rw-r--r--src/routes/start/+server.js13
-rw-r--r--static/manifest.webmanifest2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/routes/start/+server.js b/src/routes/start/+server.js
new file mode 100644
index 00000000..49474c36
--- /dev/null
+++ b/src/routes/start/+server.js
@@ -0,0 +1,13 @@
+import { auth, get } from "$lib/utils";
+import { redirect } from "@sveltejs/kit";
+
+export async function GET({ cookies }) {
+ let token = cookies.get("token");
+ let user;
+ if (token) {
+ user = await get("/me", auth(cookies));
+ throw redirect(307, `/${user.username}`);
+ }
+
+ throw redirect(307, "/");
+}
diff --git a/static/manifest.webmanifest b/static/manifest.webmanifest
index f1cdeec1..1f716600 100644
--- a/static/manifest.webmanifest
+++ b/static/manifest.webmanifest
@@ -3,7 +3,7 @@
"background_color": "#000",
"display": "fullscreen",
"scope": "/",
- "start_url": "/",
+ "start_url": "/start",
"name": "Coinos",
"description": "Bitcoin web wallet",
"short_name": "Coinos",