Compare commits
No commits in common. "52f46207ec375b488a7044afc263d6dee4e4e137" and "9a8a1e034eb0f77726d3f8c91521432d4e7905ad" have entirely different histories.
52f46207ec
...
9a8a1e034e
4 changed files with 4 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,3 @@
|
||||||
data/
|
data/
|
||||||
.fsdb
|
.fsdb
|
||||||
public/files/*
|
public/files/*
|
||||||
.vscode/*
|
|
||||||
|
|
@ -10,7 +10,6 @@ import * as CANNED_RESPONSES from '../../../utils/canned_responses.ts';
|
||||||
import * as bcrypt from '@da/bcrypt';
|
import * as bcrypt from '@da/bcrypt';
|
||||||
import { INVITE_CODE, INVITE_CODES } from '../../../models/invites.ts';
|
import { INVITE_CODE, INVITE_CODES } from '../../../models/invites.ts';
|
||||||
|
|
||||||
|
|
||||||
// TODO: figure out a better solution for doling out permissions
|
// TODO: figure out a better solution for doling out permissions
|
||||||
const DEFAULT_USER_PERMISSIONS: string[] = [
|
const DEFAULT_USER_PERMISSIONS: string[] = [
|
||||||
'files.write.own',
|
'files.write.own',
|
||||||
|
|
@ -37,14 +36,6 @@ const DEFAULT_USER_PERMISSIONS: string[] = [
|
||||||
'watches.write.own'
|
'watches.write.own'
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: figure out a better solution for doling out permissions
|
|
||||||
const DEFAULT_SUPERUSER_PERMISSIONS: string[] = [
|
|
||||||
...DEFAULT_USER_PERMISSIONS,
|
|
||||||
'topics.create',
|
|
||||||
'topics.delete',
|
|
||||||
'topics.write',
|
|
||||||
];
|
|
||||||
|
|
||||||
export const PRECHECKS: PRECHECK_TABLE = {};
|
export const PRECHECKS: PRECHECK_TABLE = {};
|
||||||
|
|
||||||
// GET /api/users - get users
|
// GET /api/users - get users
|
||||||
|
|
@ -129,7 +120,7 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
|
||||||
const at_least_one_existing_user = (await USERS.all({
|
const at_least_one_existing_user = (await USERS.all({
|
||||||
limit: 1,
|
limit: 1,
|
||||||
offset: 0
|
offset: 0
|
||||||
})).shift();
|
})).shift()?.load();
|
||||||
|
|
||||||
let root_invite_code_secret = undefined;
|
let root_invite_code_secret = undefined;
|
||||||
if (!at_least_one_existing_user) {
|
if (!at_least_one_existing_user) {
|
||||||
|
|
@ -210,10 +201,6 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!at_least_one_existing_user) {
|
|
||||||
user.permissions = DEFAULT_SUPERUSER_PERMISSIONS;
|
|
||||||
}
|
|
||||||
|
|
||||||
await USERS.create(user);
|
await USERS.create(user);
|
||||||
|
|
||||||
// automatically salted
|
// automatically salted
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
--border-highlight: hsl(from var(--base-color) h 50% 75%);
|
--border-highlight: hsl(from var(--base-color) h 50% 75%);
|
||||||
|
|
||||||
--icon-scale: 1;
|
--icon-scale: 1;
|
||||||
--border-radius: 12px;
|
--border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,9 @@
|
||||||
width: 95%;
|
width: 95%;
|
||||||
min-height: 24rem;
|
min-height: 24rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: hsl(from var(--bg) h s calc(l/1.1));
|
background: hsl(from var(--bg) h s 15);
|
||||||
max-width: 40em;
|
max-width: 40em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: var(--border-radius);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#signup-login-wall form {
|
#signup-login-wall form {
|
||||||
|
|
@ -140,6 +138,7 @@
|
||||||
id="signup-invite-code"
|
id="signup-invite-code"
|
||||||
type="text"
|
type="text"
|
||||||
name="invite_code"
|
name="invite_code"
|
||||||
|
required
|
||||||
/>
|
/>
|
||||||
<label class="placeholder" for="signup-invite-code">invite code</label>
|
<label class="placeholder" for="signup-invite-code">invite code</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue