feat: completely overhaul the auth model
* Cookies are now encrypted JWTs (GHSA-wrqq-v7qw-r5w7) * Authentication is stored in the SQLite database (auto-migrated) * Session logic is much cleaner
This commit is contained in:
parent
8cb91cd45b
commit
d2c4f5eb2b
29 changed files with 628 additions and 505 deletions
|
|
@ -22,7 +22,7 @@ export async function pruneEphemeralNodes({
|
|||
|
||||
const { nodes } = await context.client.get<{ nodes: Machine[] }>(
|
||||
'v1/node',
|
||||
session.get('api_key')!,
|
||||
session.api_key,
|
||||
);
|
||||
|
||||
const toPrune = nodes.filter((node) => {
|
||||
|
|
@ -42,10 +42,7 @@ export async function pruneEphemeralNodes({
|
|||
const promises = toPrune.map((node) => {
|
||||
return async () => {
|
||||
log.debug('api', `Pruning node ${node.name}`);
|
||||
await context.client.delete(
|
||||
`v1/node/${node.id}`,
|
||||
session.get('api_key')!,
|
||||
);
|
||||
await context.client.delete(`v1/node/${node.id}`, session.api_key);
|
||||
|
||||
await context.db
|
||||
.delete(ephemeralNodes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue