mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: return correct information
This commit is contained in:
@@ -169,7 +169,6 @@ export const authRouter = createTRPCRouter({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
get: protectedProcedure.query(async ({ ctx }) => {
|
get: protectedProcedure.query(async ({ ctx }) => {
|
||||||
console.log(ctx.user);
|
|
||||||
const auth = await findAuthById(ctx.user.id);
|
const auth = await findAuthById(ctx.user.id);
|
||||||
return auth;
|
return auth;
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ export const auth = betterAuth({
|
|||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
modelName: "users_temp",
|
modelName: "users_temp",
|
||||||
|
additionalFields: {
|
||||||
|
role: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
plugins: [organization()],
|
plugins: [organization()],
|
||||||
});
|
});
|
||||||
@@ -51,6 +56,8 @@ export const validateRequest = async (request: IncomingMessage) => {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(session);
|
||||||
|
|
||||||
if (!session?.session || !session.user) {
|
if (!session?.session || !session.user) {
|
||||||
return {
|
return {
|
||||||
session: null,
|
session: null,
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ export const findAuthByEmail = async (email: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const findAuthById = async (authId: string) => {
|
export const findAuthById = async (authId: string) => {
|
||||||
const result = await db.query.user.findFirst({
|
const result = await db.query.users_temp.findFirst({
|
||||||
where: eq(user.id, authId),
|
where: eq(users_temp.id, authId),
|
||||||
columns: {
|
columns: {
|
||||||
createdAt: false,
|
createdAt: false,
|
||||||
updatedAt: false,
|
updatedAt: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user