v3: added index default tab selection setting, fixed notification pages not loading, reduced invite token length, global player state survives page reloads, many visual fixes
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
This commit is contained in:
@@ -6,19 +6,19 @@ import { createInvite, validateInvite } from "../services/invite-service.ts";
|
||||
const router = new Router({ prefix: "/api/invites" });
|
||||
|
||||
// Create a new invite link (any authenticated user)
|
||||
router.post("/", authMiddleware, async (ctx: AuthContext) => {
|
||||
router.post("/", authMiddleware, (ctx: AuthContext) => {
|
||||
if (!ctx.state.user) {
|
||||
throw new APIException(APIErrorCode.UNAUTHORIZED, 401, "Not authenticated");
|
||||
}
|
||||
const token = await createInvite(ctx.state.user.userId);
|
||||
const token = createInvite(ctx.state.user.userId);
|
||||
ctx.response.status = 201;
|
||||
ctx.response.body = { success: true, data: { token } };
|
||||
});
|
||||
|
||||
// Validate an invite token (used by the register page before showing the form)
|
||||
router.get("/:token", async (ctx) => {
|
||||
router.get("/:token", (ctx) => {
|
||||
try {
|
||||
await validateInvite(ctx.params.token);
|
||||
validateInvite(ctx.params.token);
|
||||
ctx.response.body = { success: true, data: null };
|
||||
} catch {
|
||||
throw new APIException(
|
||||
|
||||
@@ -58,7 +58,7 @@ router.post("/register", async (ctx) => {
|
||||
}
|
||||
|
||||
// Validate invite — throws 404/409 if bad
|
||||
const inviterId = await validateInvite(body.inviteToken);
|
||||
const inviterId = validateInvite(body.inviteToken);
|
||||
|
||||
const user = await createUser(body, inviterId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user