feature: rooms and events implemented on the backend
This commit is contained in:
parent
df00324e24
commit
85024c6e62
29 changed files with 1659 additions and 115 deletions
|
@ -2,8 +2,7 @@ import { getCookies } from 'jsr:@std/http/cookie';
|
|||
import { SESSIONS } from '../models/session.ts';
|
||||
import { verifyTotp } from 'jsr:@stdext/crypto/totp';
|
||||
import { USERS } from '../models/user.ts';
|
||||
import { PERMISSIONS_STORE } from '../models/user_permissions.ts';
|
||||
import { CANNED_RESPONSES } from './canned_responses.ts';
|
||||
import * as CANNED_RESPONSES from './canned_responses.ts';
|
||||
|
||||
export type PRECHECK = (req: Request, meta: Record<string, any>) => Promise<Response | undefined> | Response | undefined;
|
||||
export type PRECHECK_TABLE = Record<string, PRECHECK[]>;
|
||||
|
@ -30,7 +29,6 @@ export async function get_user(request: Request, meta: Record<string, any>): Pro
|
|||
meta.cookies = meta.cookies ?? getCookies(request.headers);
|
||||
|
||||
meta.user = meta.valid_totp && meta.session ? await USERS.get(meta.session.user_id) : null;
|
||||
meta.user_permissions = meta.valid_totp && meta.session ? await PERMISSIONS_STORE.get(meta.session.user_id) : null;
|
||||
}
|
||||
|
||||
export function require_user(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue