Rename AcountSession to ServerSession
Start the work of clearly distingushing client side types, server side types and types shared over the API by renaming "AccountSession" and "Session" names used on the server to "ServerSession".
This commit is contained in:
parent
16191a8dd2
commit
251e83f640
15 changed files with 39 additions and 36 deletions
|
@ -2,7 +2,7 @@ import { readAccounts, writeAccounts, nextAccountId } from "~/server/database";
|
|||
import { Account } from "~/shared/types/account";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
let session = await getAccountSession(event);
|
||||
let session = await getServerSession(event);
|
||||
if (session) {
|
||||
throw createError({
|
||||
status: 409,
|
||||
|
@ -49,5 +49,5 @@ export default defineEventHandler(async (event) => {
|
|||
|
||||
accounts.push(account);
|
||||
await writeAccounts(accounts);
|
||||
await setAccountSession(event, account.id);
|
||||
await setServerSession(event, account.id);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue