Skip to content

Commit 24387f0

Browse files
thonatosJacksonTian
authored andcommitted
refactor: remove switch
1 parent 54bdd25 commit 24387f0

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

app.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,7 @@ module.exports = app => {
6565

6666
app.passport.verify(async (ctx, user) => {
6767
ctx.logger.debug('passport.verify', user);
68-
let handler;
69-
switch (user.provider) {
70-
case 'github':
71-
handler = githubHandler;
72-
break;
73-
default:
74-
handler = localHandler;
75-
}
68+
const handler = user.provider === 'github' ? githubHandler : localHandler;
7669
return handler(ctx, user);
7770
});
7871
};

0 commit comments

Comments
 (0)