Add endpoints for login and register

This commit is contained in:
2026-01-22 13:12:01 -07:00
parent 2901d62a1a
commit 126a6421d8
5 changed files with 301 additions and 2 deletions

View File

@@ -23,6 +23,8 @@ import { handler as berrydashProfilePostsPutHandler } from './routes/berrydash/p
import { handler as berryDashIconMarketplacePostHandler } from './routes/berrydash/icon-marketplace/post'
import { handler as berryDashAccountLoginPostHandler } from './routes/berrydash/account/login/post'
import { handler as berryDashAccountRegisterPostHandler } from './routes/berrydash/account/register/post'
import { handler as berryDashAccountSaveGetHandler } from './routes/berrydash/account/save/get'
import { handler as berryDashAccountSavePostHandler } from './routes/berrydash/account/save/post'
@@ -348,6 +350,36 @@ app.post(
})
}
)
app.post(
'/berrydash/account/login',
context => berryDashAccountLoginPostHandler(context),
{
detail: {
description:
'The endpoint for logging into an account. This is also the endpoint for refreshing login.',
tags: ['Berry Dash', 'Accounts']
},
body: t.Object({
username: t.String(),
password: t.String()
})
}
)
app.post(
'/berrydash/account/register',
context => berryDashAccountRegisterPostHandler(context),
{
detail: {
description: 'The endpoint for registering an account.',
tags: ['Berry Dash', 'Accounts']
},
body: t.Object({
username: t.String(),
password: t.String(),
email: t.String()
})
}
)
app.all('*', () =>
jsonResponse(
{