Skip to content

Commit

Permalink
Merge pull request #340 from cofacts/update-prettier
Browse files Browse the repository at this point in the history
[1] Update prettier
  • Loading branch information
MrOrz authored Jun 24, 2024
2 parents 0179daa + cba1a85 commit 0acdd9c
Show file tree
Hide file tree
Showing 94 changed files with 1,728 additions and 1,943 deletions.
16 changes: 11 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@typescript-eslint/parser": "^5.56.0",
"jest": "^29.0.0",
"mockdate": "^2.0.1",
"prettier": "=1.13.7",
"prettier": "^2.8.6",
"serve-handler": "^6.1.3"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jest.mock('../graphql/queries/GetUser', () => {

describe('apolloServer', () => {
const actualGraphQLServerOptions = apolloServer.graphQLServerOptions;
const mockGraphQLServerOptions = ctx => async () =>
const mockGraphQLServerOptions = (ctx) => async () =>
actualGraphQLServerOptions.call(apolloServer, { ctx });
let now;

Expand Down
26 changes: 14 additions & 12 deletions src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ export async function verifyProfile(profile, fieldName) {

if (createUserResult.result === 'created') {
return processMeta(
(await client.get({
index: 'users',
type: 'doc',
id: createUserResult._id,
})).body
(
await client.get({
index: 'users',
type: 'doc',
id: createUserResult._id,
})
).body
);
}

Expand All @@ -127,7 +129,7 @@ if (process.env.FACEBOOK_APP_ID) {
},
(token, tokenSecret, profile, done) =>
verifyProfile(profile, 'facebookId')
.then(user => done(null, user))
.then((user) => done(null, user))
.catch(done)
)
);
Expand All @@ -147,7 +149,7 @@ if (process.env.TWITTER_CONSUMER_KEY) {
},
(token, tokenSecret, profile, done) =>
verifyProfile(profile, 'twitterId')
.then(user => done(null, user))
.then((user) => done(null, user))
.catch(done)
)
);
Expand All @@ -163,7 +165,7 @@ if (process.env.GITHUB_CLIENT_ID) {
},
(token, tokenSecret, profile, done) =>
verifyProfile(profile, 'githubId')
.then(user => done(null, user))
.then((user) => done(null, user))
.catch(done)
)
);
Expand All @@ -179,7 +181,7 @@ if (process.env.GOOGLE_CLIENT_ID) {
},
(token, tokenSecret, profile, done) =>
verifyProfile(profile, 'googleId')
.then(user => done(null, user))
.then((user) => done(null, user))
.catch(done)
)
);
Expand All @@ -197,7 +199,7 @@ if (process.env.INSTAGRAM_CLIENT_ID) {
},
(token, tokenSecret, profile, done) =>
verifyProfile(profile, 'instagramId')
.then(user => done(null, user))
.then((user) => done(null, user))
.catch(done)
)
);
Expand Down Expand Up @@ -231,7 +233,7 @@ export const loginRouter = Router()
passport.authenticate('instagram', { scope: ['user_profile'] })
);

const handlePassportCallback = strategy => (ctx, next) =>
const handlePassportCallback = (strategy) => (ctx, next) =>
passport.authenticate(strategy, (err, user) => {
if (!err && !user) err = new Error('No such user');

Expand Down Expand Up @@ -268,7 +270,7 @@ export const authRouter = Router()
).split(',');

basePath =
validOrigins.find(o => o === ctx.session.origin) || validOrigins[0];
validOrigins.find((o) => o === ctx.session.origin) || validOrigins[0];
}

// TODO: Get basePath from DB for other client apps
Expand Down
2 changes: 1 addition & 1 deletion src/checkHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function checkAppId(ctx, next) {

return cors({
credentials: true,
origin: ctx => {
origin: (ctx) => {
const allowedOrigins = origin.split(',');
if (allowedOrigins.includes(ctx.get('Origin'))) return ctx.get('Origin');

Expand Down
Loading

0 comments on commit 0acdd9c

Please sign in to comment.