Compare commits
2 Commits
d7270f8696
...
5eef52e301
| Author | SHA1 | Date | |
|---|---|---|---|
| 5eef52e301 | |||
| 509e3cbc2f |
@ -13,12 +13,10 @@ export interface ClientInfoHeader {
|
||||
export const getUserHeaderInformation = (
|
||||
ctx: Context,
|
||||
): UserHeaderInformation => {
|
||||
const clientInfoHeader = JSON.parse(
|
||||
(ctx.request.headers.get("x-client-info") as string) ??
|
||||
("unknown" as string),
|
||||
) as ClientInfoHeader;
|
||||
|
||||
console.log("Client Info Header:", clientInfoHeader);
|
||||
const clientInfoHeader =
|
||||
(JSON.parse(
|
||||
ctx.request.headers.get("x-client-info") as string,
|
||||
) as ClientInfoHeader) ?? ("unknown" as string);
|
||||
|
||||
const userHeaderInformation = {
|
||||
ip: clientInfoHeader.ip ?? "unknown",
|
||||
|
||||
@ -1,13 +1,17 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { ErrorForwarder } from "../../../helpers/error/instances/forwarder";
|
||||
import { userSessionModel } from "../userSession.model";
|
||||
import { generateUUIDv7 } from "../../../helpers/databases/uuidv7";
|
||||
|
||||
export const createUserSessionRepository = async (
|
||||
data: Prisma.UserSessionUncheckedCreateInput,
|
||||
data: Omit<Prisma.UserSessionUncheckedCreateInput, "id">,
|
||||
) => {
|
||||
try {
|
||||
return await userSessionModel.create({
|
||||
data,
|
||||
data: {
|
||||
id: generateUUIDv7(),
|
||||
...data,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
isAuthenticated: true,
|
||||
|
||||
Reference in New Issue
Block a user