That's a spicy meatball
* APIUtils additions * Socket and web server listen on dedicated ports (see denoland/deno socket issue created by ZombieB1309 on GitHub) * Coach and Server created automatically (untested) * Profile content functions split into 'managers' * Progression temporary implementation * Settings placed into profile content manager * Relationships and messages return temporary empty array * Socket targets defined, message delivery to target, exec returned (goes unused for now)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
export const route = APIUtils.createRouter("/cachedlogin");
|
||||
|
||||
route.router.get("/forplatformid/:platformtype/:platformid",
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Web),
|
||||
|
||||
async (_rq, rs) => {
|
||||
const profiles = await rs.locals.user.exportAssociatedProfiles();
|
||||
|
||||
@@ -5,6 +5,7 @@ import { decode } from "@gz/jwt";
|
||||
import { Config } from "../../config.ts";
|
||||
import Logging from "@proxnet/undead-logging";
|
||||
import { z } from "zod";
|
||||
import { AuthType } from "../../data/users.ts";
|
||||
|
||||
const config = Config.getConfig();
|
||||
|
||||
@@ -75,6 +76,7 @@ interface TokenResponseBody {
|
||||
route.router.post("/token",
|
||||
|
||||
APIUtils.Authentication,
|
||||
APIUtils.AuthenticationType(AuthType.Web),
|
||||
express.urlencoded({ extended: true }),
|
||||
APIUtils.validateRequestBody<AuthBodyBase>(TokenRequestBodySchema),
|
||||
|
||||
@@ -149,6 +151,9 @@ route.router.post("/token",
|
||||
return;
|
||||
}
|
||||
|
||||
const details = await profile.export();
|
||||
log.i(`Player ${details?.username} "${details?.displayName}" (${profile.getId()}) logged in`);
|
||||
|
||||
const token = await profile.getToken();
|
||||
rs.json({
|
||||
access_token: token,
|
||||
|
||||
Reference in New Issue
Block a user