add more detail to user
This commit is contained in:
@@ -13,7 +13,9 @@ import { Config } from "./config";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import * as jwt from "jsonwebtoken";
|
||||
|
||||
const userInsertSchema = createInsertSchema(user);
|
||||
const userInsertSchema = createInsertSchema(user, {
|
||||
cid: (schema) => schema.cid.length(13),
|
||||
});
|
||||
const opinionInsertSchema = createInsertSchema(userOpinion)
|
||||
.omit({
|
||||
userId: true,
|
||||
@@ -190,7 +192,7 @@ async function verifyOtp(token: string, pin: string) {
|
||||
} else {
|
||||
await db.delete(phoneToken).where(eq(phoneToken.phone, pt.phone));
|
||||
const token = jwt.sign({ phone: pt.phone }, Config.jwt_secret, {
|
||||
expiresIn: "3d",
|
||||
expiresIn: "365d",
|
||||
});
|
||||
return token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user