lint
All checks were successful
backend-action / build-image (push) Successful in 1m9s

This commit is contained in:
2024-05-16 17:26:27 +07:00
parent 5c4abf24bb
commit c1a019a461
13 changed files with 246 additions and 63 deletions

View File

@@ -42,7 +42,7 @@ export const createContext = async (opts: CreateHTTPContextOptions) => {
const bearerToken = authorizationHeader.split(" ")[1];
const phone = await verifyToken(bearerToken);
if (phone !== null) {
let user = await db.query.user.findFirst({
const user = await db.query.user.findFirst({
where: (user, { eq }) => eq(user.phone, phone),
});
return {
@@ -59,7 +59,7 @@ export const createContext = async (opts: CreateHTTPContextOptions) => {
async function verifyToken(token: string): Promise<string | null> {
try {
let rs = await new Promise((resolve, reject) => {
const rs = await new Promise((resolve, reject) => {
jwt.verify(token, Config.jwt_secret, (err, decoded) => {
if (err) {
reject(err);
@@ -68,7 +68,7 @@ async function verifyToken(token: string): Promise<string | null> {
}
});
});
let data = z
const data = z
.object({
phone: z.string(),
})