Removed web project (galvanic authentication support in IL2CPP universal patch)
Moved instance ID to header User instances for profile management .. other stuff
This commit is contained in:
30
src/routes/account/account.ts
Normal file
30
src/routes/account/account.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
import Profile from "../../data/profiles.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/account");
|
||||
|
||||
interface CreateAccountRequestBody {
|
||||
platform: string,
|
||||
platformId: string,
|
||||
deviceId: string
|
||||
}
|
||||
|
||||
route.router.post('/create',
|
||||
|
||||
APIUtils.UserAuthentication,
|
||||
express.urlencoded({ extended: true }),
|
||||
APIUtils.checkBodyTypes<CreateAccountRequestBody>({platform: "", platformId: "", deviceId: ""}),
|
||||
|
||||
async (_rq, rs) => {
|
||||
const newAcc = await Profile.init();
|
||||
|
||||
rs.locals.user.addAssociatedProfile(newAcc.getId());
|
||||
|
||||
rs.json({
|
||||
success: true,
|
||||
value: await newAcc.export()
|
||||
});
|
||||
},
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user