yes
This commit is contained in:
@@ -49,6 +49,7 @@ export const apiAuthRouter = createTRPCRouter({
|
|||||||
)
|
)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input }) => {
|
||||||
console.log("[=] Getting new session... ", input);
|
console.log("[=] Getting new session... ", input);
|
||||||
|
try {
|
||||||
const { captchaId, captchaAnswer } = input;
|
const { captchaId, captchaAnswer } = input;
|
||||||
let { userId, userType, password } =
|
let { userId, userType, password } =
|
||||||
await dbApiUser.getRandomDistributor();
|
await dbApiUser.getRandomDistributor();
|
||||||
@@ -82,6 +83,13 @@ export const apiAuthRouter = createTRPCRouter({
|
|||||||
}
|
}
|
||||||
await setSessionToRedis(token.message, input.userId ?? "");
|
await setSessionToRedis(token.message, input.userId ?? "");
|
||||||
return { success: true, errors: [] as ServerError };
|
return { success: true, errors: [] as ServerError };
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
throw new TRPCError({
|
||||||
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
|
message: "Error getting new session.",
|
||||||
|
});
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
isApiSessionValid: protectedProcedure
|
isApiSessionValid: protectedProcedure
|
||||||
|
|||||||
Reference in New Issue
Block a user