rename direct signup hash to code

This commit is contained in:
bytedream committed 2026-10-30 10:45:14 +01:00
1 parent 51b3b446eb
commit f2ca4747a6
10 files changed
+41 -41

No files matched your search

+6 -6
View File
@@ -29,12 +29,12 @@ export const signup = {
phone: z.string().trim().nullable(),
username: z.string().trim(),
edition: z.enum(['java', 'bedrock']),
hash: z.string().nullish()
code: z.string().nullish()
}),
handler: async (input, context) => {
// check if hash given and if so, if it's valid and nobody has already used it
if (input.hash) {
const directSignup = await db.getDirectSignupByHash({ hash: input.hash });
// check if code given and if so, if it's valid and nobody has already used it
if (input.code) {
const directSignup = await db.getDirectSignupByCode({ code: input.code });
if (!directSignup) {
throw new ActionError({
@@ -84,8 +84,8 @@ export const signup = {
uuid: uuid
});
if (input.hash) {
await tx.setDirectSignupUser({ hash: input.hash, userId: user.id });
if (input.code) {
await tx.setDirectSignupUser({ code: input.code, userId: user.id });
}
});