Skip to content

Commit

Permalink
fix: local development
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshnirmalya committed Jan 16, 2021
1 parent 65a6f9a commit bc5e9fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
HASURA_GRAPHQL_ADMIN_SECRET=secret
PORT=8080
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_DB=database
DATABASE_URL=postgresql://user:password@db:5432/database
10 changes: 5 additions & 5 deletions frontend/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const options = {
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
ssl: true,
extra: {
ssl: process.env.NODE_ENV === "production",
extra: process.env.NODE_ENV === "production" && {
ssl: {
rejectUnauthorized: false,
},
Expand All @@ -33,7 +33,7 @@ const options = {
jwt: true,
},
jwt: {
encode: async ({ token, secret }: { token: iToken; secret: string }) => {
encode: async ({ token }: { token: iToken }) => {
const tokenContents = {
id: token.id,
name: token.name,
Expand All @@ -56,7 +56,7 @@ const options = {

return encodedToken;
},
decode: async ({ token, secret }: { token: string; secret: string }) => {
decode: async ({ token }: { token: string }) => {
const decodedToken = jwt.verify(token, jwtSecret.key, {
algorithms: jwtSecret.type,
});
Expand All @@ -76,7 +76,7 @@ const options = {

return Promise.resolve(session);
},
jwt: async (token: iToken, user: IUser, account, profile, isNewUser) => {
jwt: async (token: iToken, user: IUser) => {
const isSignIn = user ? true : false;

if (isSignIn) {
Expand Down

1 comment on commit bc5e9fb

@vercel
Copy link

@vercel vercel bot commented on bc5e9fb Jan 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.