mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
refactor: ♻️ Always use explicit types in every function
This commit is contained in:
parent
54cea29ce9
commit
c1dcdc78ae
62 changed files with 359 additions and 226 deletions
|
|
@ -1,12 +1,18 @@
|
|||
import { db } from "@versia/kit/db";
|
||||
import { Challenges } from "@versia/kit/tables";
|
||||
import { createChallenge } from "altcha-lib";
|
||||
import type { Challenge } from "altcha-lib/types";
|
||||
import { sql } from "drizzle-orm";
|
||||
import { config } from "~/packages/config-manager";
|
||||
|
||||
export const generateChallenge = async (
|
||||
maxNumber = config.validation.challenges.difficulty,
|
||||
) => {
|
||||
): Promise<{
|
||||
id: string;
|
||||
challenge: Challenge;
|
||||
expiresAt: string;
|
||||
createdAt: string;
|
||||
}> => {
|
||||
const expirationDate = new Date(
|
||||
Date.now() + config.validation.challenges.expiration * 1000,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue