🐛 fix: user client info in oauth flow
This commit is contained in:
@ -1,11 +1,14 @@
|
||||
import { Google } from "arctic";
|
||||
import { getOauthProviders } from "../../../config/oauthProvider";
|
||||
|
||||
export const googleProvider = (
|
||||
callbackURI = `${process.env.APP_PROTOCOL}://${process.env.APP_DOMAIN}${process.env.GOOGLE_DEFAULT_CALLBACK}`
|
||||
callbackURI = `${process.env.APP_PROTOCOL}://${process.env.APP_DOMAIN}:${
|
||||
process.env.APP_PORT
|
||||
}/${getOauthProviders().find((p) => p.name === "google")?.client_callback}`,
|
||||
) => {
|
||||
return new Google(
|
||||
process.env.GOOGLE_CLIENT_ID!,
|
||||
process.env.GOOGLE_CLIENT_SECRET!,
|
||||
callbackURI
|
||||
callbackURI,
|
||||
);
|
||||
};
|
||||
|
||||
@ -23,14 +23,13 @@ type CreateUserSessionResponse = Prisma.UserSessionGetPayload<{
|
||||
}>;
|
||||
|
||||
export const createUserSessionRepository = async (
|
||||
data: Prisma.UserSessionUncheckedCreateInput
|
||||
data: Prisma.UserSessionUncheckedCreateInput,
|
||||
) => {
|
||||
try {
|
||||
return await userSessionModel.create({
|
||||
data,
|
||||
select: {
|
||||
id: true,
|
||||
deviceType: true,
|
||||
isAuthenticated: true,
|
||||
validUntil: true,
|
||||
user: {
|
||||
@ -42,6 +41,12 @@ export const createUserSessionRepository = async (
|
||||
avatar: true,
|
||||
birthDate: true,
|
||||
bioProfile: true,
|
||||
preference: {
|
||||
omit: {
|
||||
updatedAt: true,
|
||||
createdAt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user