diff --git a/public/api/auth/index.ts b/public/api/auth/index.ts
index c69d8cf..7d47e32 100644
--- a/public/api/auth/index.ts
+++ b/public/api/auth/index.ts
@@ -6,10 +6,11 @@ import { SESSION, SESSIONS } from '../../../models/session.ts';
import { TOTP_ENTRIES } from '../../../models/totp_entry.ts';
import { encodeBase64 } from '@std/encoding/base64';
import parse_body from '../../../utils/bodyparser.ts';
-import { get_session, get_user, PRECHECK_TABLE, require_user, SESSION_ID_TOKEN, SESSION_SECRET_TOKEN } from '../../../utils/prechecks.ts';
+import { AUTHED_BEFORE_COOKIE_ID, get_session, get_user, PRECHECK_TABLE, require_user, SESSION_ID_TOKEN, SESSION_SECRET_TOKEN } from '../../../utils/prechecks.ts';
import * as bcrypt from '@da/bcrypt';
import { verifyTotp } from '../../../utils/totp.ts';
+const AUTHED_BEFORE_EXPIRATION: number = 399 * (24 * (60 * (60 * 1_000))); // 399 days
const DEFAULT_SESSION_TIME: number = 365 * (24 * (60 * (60 * 1_000))); // 365 days
export const PRECHECKS: PRECHECK_TABLE = {};
@@ -206,6 +207,7 @@ export async function create_new_session(session_settings: SESSION_INFO): Promis
const headers = new Headers();
const expires_in_utc = new Date(session.timestamps.expires).toUTCString();
+ headers.append('Set-Cookie', `${AUTHED_BEFORE_COOKIE_ID}=1; Path=/; Secure; Expires=${new Date(new Date(now).valueOf() + AUTHED_BEFORE_EXPIRATION).toUTCString()}`);
headers.append('Set-Cookie', `${SESSION_ID_TOKEN}=${session.id}; Path=/; Secure; Expires=${expires_in_utc}`);
headers.append(`x-${SESSION_ID_TOKEN}`, session.id);
diff --git a/public/base.css b/public/base.css
index 2314781..cab56f7 100644
--- a/public/base.css
+++ b/public/base.css
@@ -169,6 +169,15 @@ body {
/* fixed height? */
}
+#background-container {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ z-index: -1;
+}
+
main {
position: relative;
width: 100%;
diff --git a/public/index.html b/public/index.html
index 4b48483..2b5a262 100644
--- a/public/index.html
+++ b/public/index.html
@@ -3,13 +3,14 @@
- autonomous.contact
+
+
@@ -45,6 +46,8 @@
+
+
diff --git a/public/js/api.js b/public/js/api.js
index a306e84..0ac9755 100644
--- a/public/js/api.js
+++ b/public/js/api.js
@@ -5,10 +5,13 @@ const api = {
...__options,
};
+ // FIXME: this will break with different server settings
+ // TODO: we need the cookie names here to match any configured on the server
const session_id = (document.cookie.match(
/^(?:.*;)?\s*session_id\s*=\s*([^;]+)(?:.*)?$/,
) || [, null])[1];
+ // FIXME: this will break with different server settings
// TODO: this wasn't really intended to be persisted in a cookie
const session_secret = (document.cookie.match(
/^(?:.*;)?\s*session_secret\s*=\s*([^;]+)(?:.*)?$/,
diff --git a/public/signup_login_wall.html b/public/signup_login_wall.html
index a1227c0..f56b8f7 100644
--- a/public/signup_login_wall.html
+++ b/public/signup_login_wall.html
@@ -14,7 +14,19 @@
background: var(--bg);
visibility: visible;
opacity: 1;
- transition: all 0.33s;
+ transition: all 0.33s ease;
+ animation: slideIn 0.4s ease;
+ }
+
+ @keyframes slideIn {
+ from {
+ opacity: 0;
+ transform: scale(1.2);
+ }
+ to {
+ opacity: 1;
+ transform: scale(1.0);
+ }
}
#login-tab .tab-content {
@@ -49,52 +61,17 @@
}
-
+
+
+
+
diff --git a/public/tabs/calendar/calendar.html b/public/tabs/calendar/calendar.html
index e95b222..be736d3 100644
--- a/public/tabs/calendar/calendar.html
+++ b/public/tabs/calendar/calendar.html
@@ -11,6 +11,6 @@
Calendar
-
+
diff --git a/public/tabs/exchange/exchange.html b/public/tabs/exchange/exchange.html
index c436b03..ca25f3f 100644
--- a/public/tabs/exchange/exchange.html
+++ b/public/tabs/exchange/exchange.html
@@ -11,6 +11,6 @@
Exchange
-
+
diff --git a/public/tabs/home/home.html b/public/tabs/home/home.html
index 4352892..99afa6d 100644
--- a/public/tabs/home/home.html
+++ b/public/tabs/home/home.html
@@ -12,6 +12,6 @@
Home
-
+
diff --git a/public/tabs/resources/resources.html b/public/tabs/resources/resources.html
index 7f56def..af8c024 100644
--- a/public/tabs/resources/resources.html
+++ b/public/tabs/resources/resources.html
@@ -10,5 +10,5 @@
>
Resources
-
+
diff --git a/public/tabs/tabs.html b/public/tabs/tabs.html
index 60741d6..96f4319 100644
--- a/public/tabs/tabs.html
+++ b/public/tabs/tabs.html
@@ -111,21 +111,13 @@
@media screen and (max-width: 800px) {
.tab-label {
- width: 3rem;
- }
-
- .tab-label .label {
- font-size: small;
+ width: 4rem;
}
}
@media screen and (max-width: 400px) {
.tab-label {
- width: 2.5rem;
- }
-
- .tab-label .label {
- font-size: 8px;
+ width: 3rem;
}
}
diff --git a/public/tabs/work/work.html b/public/tabs/work/work.html
index 7f44be9..2b83ce3 100644
--- a/public/tabs/work/work.html
+++ b/public/tabs/work/work.html
@@ -10,5 +10,5 @@
>
Work
-
+
diff --git a/utils/prechecks.ts b/utils/prechecks.ts
index 2c910b9..1aecdc9 100644
--- a/utils/prechecks.ts
+++ b/utils/prechecks.ts
@@ -8,6 +8,7 @@ import { EVENT } from '../models/event.ts';
export type PRECHECK = (req: Request, meta: Record) => Promise | Response | undefined;
export type PRECHECK_TABLE = Record;
+export const AUTHED_BEFORE_COOKIE_ID: string = Deno.env.get('AUTHED_BEFORE_COOKIE_ID') ?? 'authed_before';
export const SESSION_ID_TOKEN: string = Deno.env.get('SESSION_ID_TOKEN') ?? 'session_id';
export const SESSION_SECRET_TOKEN: string = Deno.env.get('SESSION_SECRET_TOKEN') ?? 'session_secret';
export const TOTP_TOKEN: string = Deno.env.get('TOTP_TOKEN') ?? 'totp';