remove channel info stuff
This commit is contained in:
parent
557ea7ede5
commit
18f1f2afed
@ -1,5 +1,5 @@
|
||||
import { createSession as createSession } from '../utils/token.js';
|
||||
import { getChannelInfo, getUserInfo } from '../utils/youtube.js';
|
||||
import { getUserInfo } from '../utils/youtube.js';
|
||||
import { db } from '../db/index.js';
|
||||
import { sessions, sites, users, users as usersTable } from '../db/schemas.js';
|
||||
import { eq } from 'drizzle-orm';
|
||||
@ -26,7 +26,7 @@ export const authRoutes = (fastify, _, done) => {
|
||||
reply.status(400).send({ success: false, message: "Provider email is not verified" });
|
||||
return;
|
||||
}
|
||||
const channel_info = await getChannelInfo(token.access_token);
|
||||
//const channel_info = await getChannelInfo(token.access_token);
|
||||
|
||||
const [existing_user] = await db.select().from(usersTable).where(eq(usersTable.google_id, user_info.id));
|
||||
|
||||
@ -49,13 +49,14 @@ export const authRoutes = (fastify, _, done) => {
|
||||
name: user_info.name,
|
||||
google_id: user_info.id,
|
||||
email: user_info.email,
|
||||
channel_id: channel_info.id,
|
||||
uploads_playlist_id: channel_info.contentDetails.relatedPlaylists.uploads,
|
||||
// channel_id: channel_info.id,
|
||||
channel_id: "TEMP_DISABLED",
|
||||
// uploads_playlist_id: channel_info.contentDetails.relatedPlaylists.uploads,
|
||||
uploads_playlist_id: "TEMP_DISABLED",
|
||||
stripe_id: customer.id
|
||||
}).returning({ id: usersTable.id });
|
||||
// console.log("user ", user)
|
||||
console.log("USER MADE")
|
||||
console.log("user", user);
|
||||
// console.log("USER MADE")
|
||||
// console.log("user", user);
|
||||
await tx.insert(sites).values({
|
||||
name: `${user_info.name}'s Website`,
|
||||
user_id: user.id
|
||||
|
@ -407,6 +407,7 @@ export async function getChannelInfo(access_token) {
|
||||
return channel.data.items[0];
|
||||
}
|
||||
|
||||
|
||||
/** @typedef {{name: string, email: string, isVerified: boolean}} UserInfo */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user