Skip to content

Commit

Permalink
Respect account creation privilege in Google sign in.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Dec 15, 2024
1 parent 2040c81 commit cbebed6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/service/passport/strategies/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class GoogleStrategy {
return cb(null, existingUser);
}
if (type === GoogleLoginType.LOGIN) return cb(null, {});
if (!Configuration.get("privilege.can-create-account")) {
log.warn("Account creation is disabled.");
return cb(new Error("Account creation is disabled."), undefined);
}
log.info("Creating user from Google profile.");
const role = Configuration.get("system.role.default");
const credits = Configuration.get("user.account-creation.initial-credit-count");
Expand Down

0 comments on commit cbebed6

Please sign in to comment.