Skip to content

Commit

Permalink
Changing truthy to explicit comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Aug 17, 2017
1 parent 520b684 commit 04b2ca6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function auth (obj, config) {
passport.use(new BasicStrategy((username, password, done) => {
delay(() => {
validate(username, (err, user) => {
if (err) {
if (err !== null) {
return done(err);
}

Expand Down Expand Up @@ -291,7 +291,7 @@ function auth (obj, config) {
passport.use(new BearerStrategy((token, done) => {
delay(() => {
validate(token, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else if (!user) {
done(null, false);
Expand Down Expand Up @@ -321,7 +321,7 @@ function auth (obj, config) {
}, (accessToken, refreshToken, profile, done) => {
delay(() => {
config.auth.facebook.auth(accessToken, refreshToken, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -344,7 +344,7 @@ function auth (obj, config) {
}, (identifier, profile, done) => {
delay(() => {
config.auth.google.auth.call(obj, identifier, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand Down Expand Up @@ -377,7 +377,7 @@ function auth (obj, config) {
passport.use(new JWTStrategy(opts, (token, done) => {
delay(() => {
config.auth.jwt.auth(token, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -399,7 +399,7 @@ function auth (obj, config) {
}, (token, tokenSecret, profile, done) => {
delay(() => {
config.auth.linkedin.auth(token, tokenSecret, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -419,7 +419,7 @@ function auth (obj, config) {
passport.use(new LocalStrategy((username, password, done) => {
delay(() => {
config.auth.local.auth(username, password, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand Down Expand Up @@ -460,7 +460,7 @@ function auth (obj, config) {
}, (accessToken, refreshToken, profile, done) => {
delay(() => {
config.auth.oauth2.auth(accessToken, refreshToken, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -487,7 +487,7 @@ function auth (obj, config) {
passport.use(new SAMLStrategy(arg, (profile, done) => {
delay(() => {
config.auth.saml.auth(profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -511,7 +511,7 @@ function auth (obj, config) {
}, (accessToken, refreshToken, profile, done) => {
delay(() => {
config.auth.slack.auth(accessToken, refreshToken, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand All @@ -535,7 +535,7 @@ function auth (obj, config) {
}, (token, tokenSecret, profile, done) => {
delay(() => {
config.auth.twitter.auth(token, tokenSecret, profile, (err, user) => {
if (err) {
if (err !== null) {
done(err);
} else {
done(null, user);
Expand Down

0 comments on commit 04b2ca6

Please sign in to comment.