Skip to content

Instantly share code, notes, and snippets.

View Tosinkoa's full-sized avatar

Paul Ojo Tosinkoa

View GitHub Profile
```
-- CreateTable
CREATE TABLE "session" (
"sid" VARCHAR NOT NULL,
"sess" JSON NOT NULL,
"expire" TIMESTAMP() NOT NULL,
CONSTRAINT "session_pkey" PRIMARY KEY ("sid")
);
-- migrate:up
create table session (
sid text primary key not null,
sess json not null,
expire timestamp() not null
);
-- migrate:down
drop table if exists users;
drop table if exists slot;
drop table if exists verify_token;
drop table if exists winner;
// Google auth logic
const { generateFromEmail } = require("unique-username-generator")
const passport = require("passport")
const GoogleStrategy = require("passport-google-oauth2").Strategy
const bcrypt = require("bcryptjs")
const crypto = require("crypto")
const pool = require("../LIB/DB-Client")
passport.use(
new GoogleStrategy(
import express from "express"
import rootRoute from "./src/root_Route.js"
import cookieParser from "cookie-parser"
import passport from "passport"
import connectPgSimple from "connect-pg-simple"
import session from "express-session"
import dotenv from "dotenv"
import cors from "cors"
import "./src/LIB/DB-Client.js"
import "./src/PASSPORT_STRATEGY/google-auth-strategy.js"
-----------------------------------server.js----------------------------------------
************************************************************************************
import express from "express"
import rootRoute from "./src/root_Route.js"
import cookieParser from "cookie-parser"
import passport from "passport"
import connectPgSimple from "connect-pg-simple"
import session from "express-session"
import dotenv from "dotenv"
import cors from "cors"