bugfix
This commit is contained in:
parent
661f93350f
commit
895fb12140
@ -29,7 +29,7 @@ export const authRoutes = (fastify, _, done) => {
|
|||||||
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));
|
const [existing_user] = await db.select().from(usersTable).where(eq(usersTable.google_id, user_info.id));
|
||||||
console.log("existing user", existing_user);
|
|
||||||
let user;
|
let user;
|
||||||
let session_id;
|
let session_id;
|
||||||
await db.transaction(async tx => {
|
await db.transaction(async tx => {
|
||||||
|
@ -399,7 +399,7 @@ export async function getChannelInfo(access_token) {
|
|||||||
part: "id,contentDetails,snippet",
|
part: "id,contentDetails,snippet",
|
||||||
mine: true,
|
mine: true,
|
||||||
maxResults: 1
|
maxResults: 1
|
||||||
}, {agent}).then(res => res);
|
}).then(res => res);
|
||||||
|
|
||||||
if (!channel.data.items[0]) {
|
if (!channel.data.items[0]) {
|
||||||
throw new Error("no_channel");
|
throw new Error("no_channel");
|
||||||
|
Loading…
Reference in New Issue
Block a user