Skip to content

Commit

Permalink
fix: prettier upgrade fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Jun 23, 2024
1 parent 60c3c16 commit cba1a85
Show file tree
Hide file tree
Showing 92 changed files with 1,716 additions and 1,937 deletions.
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 cba1a85

Please sign in to comment.