Skip to content

Commit

Permalink
changed typescript const assertion in viewer resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
jalajcodes committed Oct 20, 2020
1 parent cc8de47 commit 886b7f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/graphql/resolvers/Viewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { Response, Request } from 'express';
const cookieOptions = {
httpOnly: true,
signed: true,
sameSite: 'none' as const,
sameSite: 'none',
secure: process.env.NODE_ENV === 'development' ? false : true,
domain: 'netlify.app',
};
} as const;

const cookieExpiry = process.env.COOKIE_EXPIRY
? parseInt(process.env.COOKIE_EXPIRY) * 24 * 60 * 60 * 1000
Expand Down Expand Up @@ -83,7 +83,6 @@ const loginViaGoogle = async (code: string, token: string, db: Database, res: Re
}

// Set the cookie

res.cookie('viewer', userId, {
...cookieOptions,
maxAge: cookieExpiry,
Expand Down
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ const mount = async (app: Application) => {
// Connect to database
const db = await connectDatabase();

// const corsOptions: CorsOptions = {
// origin: 'https://homesweethomee.netlify.app',
// credentials: true,
// };

// app.use(cors(corsOptions));
// app.use(express.json({ limit: '2mb' }));
app.use(cookieParser(process.env.COOKIE_SECRET));

// Instantiate apollo server instance
Expand Down

0 comments on commit 886b7f6

Please sign in to comment.