at least we are in the dorm now

This commit is contained in:
Devin Zuczek
2026-06-14 21:32:37 -04:00
parent 768ca2a0a3
commit 2f70eab186
14 changed files with 310 additions and 28 deletions
+4
View File
@@ -58,6 +58,10 @@ const app = new Hono<App>()
])
})
// Bulk cached-login lookup by platform id (friends resolution). The client
// POSTs repeated `id=` params on the auth host; no DB → no matches → [].
.post('/cachedlogin/forplatformids', (c) => c.json([]))
// OAuth token endpoint — accepts a form-urlencoded body and issues a JWT.
.post('/connect/token', async (c) => {
// The C# reads `grant_type`, `account_id`, `platform_id` and `platform` from
@@ -99,6 +99,16 @@ describe('auth worker routes', () => {
expect(payload.platform).toBe('Steam')
})
test('POST /cachedlogin/forplatformids returns []', async () => {
const res = await exports.default.fetch(`${ORIGIN}/cachedlogin/forplatformids`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: 'id=76561197971551621&id=76561197976728738',
})
expect(res.status).toBe(200)
expect(await res.json()).toEqual([])
})
test('GET /role/developer/:id returns ok', async () => {
const res = await exports.default.fetch(`${ORIGIN}/role/developer/42`)
expect(res.status).toBe(200)