Skip to content

Commit

Permalink
remove lints errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneleon1 committed May 7, 2024
1 parent e5e6413 commit 678fdc1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"no-console": "warn",
"quotes": ["error", "single"]
},
"ignorePatterns": ["dist/**/*"]
"ignorePatterns": ["dist/**/*", "src/middlewares/passport-setup.ts"]
}
7 changes: 5 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ app.use(
);

// register regenerate & save after the cookieSession middleware initialization
interface CallbackFunction {
(err?: string): void;
}
app.use(function (request: Request, response: Response, next: NextFunction) {
if (request.session && !request.session.regenerate) {
request.session.regenerate = (cb: any) => {
request.session.regenerate = (cb: CallbackFunction) => {
cb();
};
}
if (request.session && !request.session.save) {
request.session.save = (cb: any) => {
request.session.save = (cb: CallbackFunction) => {
cb();
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/database/models/userModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export class UserModel {
@Column({ nullable: true })
googleId: string;

@Column({ default: null })
@Column({ nullable: true })
facebookId: string;

@Column({ default: null })
@Column({ nullable: true })
picture: string;

@Column({ default: null })
@Column({ nullable: true })
provider: string;

@Column({ default: 'buyer' })
Expand Down
4 changes: 1 addition & 3 deletions src/middlewares/passport-setup.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import passport, { use } from 'passport';
import passport from 'passport';
import GooglePassport from 'passport-google-oauth20';
import FacebookPassport from 'passport-facebook';
import dbConnection from '../database';
import { UserModel } from '../database/models';
import dotenv from 'dotenv';
dotenv.config();
import sendEmail from '../emails/index';
import jwt from 'jsonwebtoken';

const userRepository = dbConnection.getRepository(UserModel);

Expand Down

0 comments on commit 678fdc1

Please sign in to comment.